is-what
is-what copied to clipboard
Use `unknown` instead of `any`
CURRENTLY
We currently use any
a lot like. Eg.:

This currently makes stuff like this possible without error:

PROPOSAL
When the user passes an array with "any" we could also convert the outcome to "unknown" instead like so:

Which will result in throwing errors because the type was converted from any
to unknown
:

As long as the array type is not any[]
it will keep the array type as is:

@laquasicinque thoughts?
the proposal comes from:
On a related note, you may wish to define an object like:
// like in TS library files
Record<keyof any, unknown>
// or verbosely without the any
Record<string | number | symbol, unknown>
will land in v5