3 ms·
> Usually the lie is in your own code or bad dependencies when an “unknown” type (including “any”) is cast to a concrete type without being validated. Yes, but
by consilient 3y ago
> Usually the lie is in your own code or bad dependencies when an “unknown” type (including “any”) is cast to a concrete type without being validated.
Yes, but one of those bad dependencies is the standard library.
- __ryan__ 3y agoWhen does the standard library lie in this case?
- consilient 3y agoThings are `any` when they should be `unknown` or generic, mostly. Off the top of my head: - `JSON.parse` and `.json()` on response bodies both return `any`. - `JSON.stringify`'s `replacer` argument is of type `(key: any, string: any) => any`. - `PromiseRejectedResult["reason"]` is `any`. There are certainly many others.