ts-reset
ts-reset copied to clipboard
Typed the error param of `Promise.catch` as `unknown`
When using try...catch in strict mode (or with the useUnknownInCatchVariables tsconfig flag enabled) the type of error is unknown
try {} catch (error) {}
// ^? error: unknown
However when working with promises, the type of a caught error is any
Promise.resolve().catch((error) => {});
// ^? error: any
This PR changes the type of error to unknown for consistency (and type safety)
Promise.resolve().catch((error) => {});
// ^? error: unknown
This looks great, can we have it merged /