-
-
Notifications
You must be signed in to change notification settings - Fork 601
Add ExtractStrict
and ExcludeStrict
types
#291
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
Conversation
Thanks for contributing these types. Make sure you read and adhere to https://github.com/sindresorhus/type-fest/blob/main/.github/contributing.md |
You also need to add the types to the readme. |
@@ -0,0 +1,18 @@ | |||
/** | |||
Constructs a type by excluding from Type all union members that are assignable to ExcludedUnion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this description could be written a little bit clearer.
I think this would be a requirement for this to be merged as otherwise it's not proven that these types actually work, even if they do, they might accidentally regress in the future. Did you try using |
I agree one hundred percent 😅
Yeah, but I did not succeed after trying for 30 minutes. I'll just try again; I'm sure I'll manage if I give it enough time. I'll come back to fix this this sometime within the next few months. |
//=> 'xxxl' | 'xxl' | 'xl' | 'l'; | ||
``` | ||
|
||
@category Utilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also have a category for utilities that are better versions of builtins. Maybe called Improved builtin
?
@category Utilities | |
@category Improved builtin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a great idea. 👍
Please excuse me for taking so long to incorporate your suggestions, @sindresorhus. I'm currently finishing a book, and I do not expect to have time to finish this PR before the middle of February. |
No worries. I'll leave this open until you have some time. |
29f3df0
to
08de69b
Compare
Friendly bump :) |
Solves #222
I could not figure out how to make test cases to demonstrate that these types fail when you supply an ExcludedUnion or Union that includes an element which is not found in Type. If someone knows how, a contribution is very welcome!