mesqueeb / is-what

JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.
https://mesqueeb.github.io/is-what/
MIT License
169 stars 18 forks source link

Change any to unknown #10

Closed shian15810 closed 3 years ago

shian15810 commented 4 years ago

Change any to unknown, as unknown is far more type safe than any.

This will force users to use type assertion like someValue as string or do further type check like someValue is string.

This change will make the codebase using this library more type aware syntax wise, and also visually.

This is definitely a breaking change.

But I suppose most users are using this library to be more type aware of their codes anyway.

Should be a move in the right direction.

mesqueeb commented 3 years ago

@shian15810 thanks for your suggestion. I'm thinking about it, but only after the dust settles down a bit a few months after Vue 3 is released.

I see myself going into 2021 with no more JS projects and much better TS support for Vue projects. That's when I'll revisit this.

--
is-what was made with ♥ by Luca Ban.
If you use this library in your projects, you can support the maintenance of this library by a small contribution via Github 💜.
You can also reach out on twitter if you want a one-on-one coding review/lesson. 🦜