Open sindresorhus opened 6 years ago
There's a catch all any
method https://github.com/sindresorhus/ow/blob/db4af81a7e9de6a1c61d92e02121fb03982fd6e6/source/index.ts#L55. This mess is only needed for better type inference because the catch all just returns a generic predicate and not a specific one.
Not sure about the unknown
type, I'll need to check the codebase.
We should look into whether we can use any of these new features: https://devblogs.microsoft.com/typescript/announcing-typescript-3-4/
It's out: https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/
We can probably replace this mess https://github.com/sindresorhus/ow/blob/db4af81a7e9de6a1c61d92e02121fb03982fd6e6/source/index.ts#L45-L54 with generic spreading.
@SamVerschueren I tried removing the above code and the test still passes. Are the tests faulty or is that code moot?
Do you think there are any places we should use the
unknown
keyword?