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
Add ConditionalKeys
, ConditionalPick
and ConditionalExcept
types
#76
Conversation
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.
There's some minor errors, but overall I love this proposal, and I thank you for your contribution
Nah. |
I'll address the requested changes once I have a few moments. |
dadae29
to
7f437b2
Compare
I've addressed the requested changes with some minor deviations as explained above. |
/cc @sindresorhus LGTM. |
Merged in 1... 2... 3... 😛 |
ConditionalKeys
, ConditionalPick
and ConditionalExcept
typesConditionalKeys
, ConditionalPick
and ConditionalExcept
types
Thanks, @ifiokjr 👌 |
Description
Add types to conditionally pick and exclude properties from any shape based on the provided
Condition
.This type comes in handy quite a lot in my library code bases where transforming types or picking properties based on conditions helps dynamically drive automatic inference.
Any suggestions for better names is welcome. Since this code base provides the
Except
type I've used the nameConditionalExcept
. However, it might be more understandable to useConditionalOmit
.