-
-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: IfAny
, IsAny
, IsUnknown
, etc
#129
Comments
@sindresorhus I think this would be very helpful. |
What would you use it for? |
I have a new package I'm working on, which works with objects. This would help me manage things. If this doesn't get added, I don't really mind, it's already an amazing library. Thanks @sindresorhus 👍 |
Alright. This is PR welcome. The submitter should make sure to follow https://github.com/sindresorhus/type-fest/blob/master/.github/contributing.md closely. |
I've started working on this, but I'm struggling to think of use cases for these beyond being helpers in other types. I also started by making both an type IsAny<T, TypeIfAny = true, TypeIfNotAny = false> = 0 extends 1 & T ? TypeIfAny : TypeIfNotAny;
IsAny<any> //=> true
IsAny<number> //=> false
IsAny<any, number, string> //=> number I kind of like that Footnotes
|
https://github.com/sindresorhus/type-fest/pull/127/files#r474306457
Thoughts?
The text was updated successfully, but these errors were encountered: