-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
: add option with exclude/keep specified type on deep type
#862
Comments
One could also do: type SimplifyItem = SimplifyDeep<Omit<Item, 'color'>> & Pick<Item, 'color'>; And if one wants a helper to keep it a bit shorter one could do something like this in ones types: type SimplifyDeepExcept<A, B extends keyof A> = SimplifyDeep<Omit<A,B>> & Pick<A, B>; Is it common that that needs to exclude something like |
My case is more complicated. |
This proposal makes sense to me. |
Sorry, I found I could use |
Look at this scene
I have a type
Item
that wrapped with some util type, and I want get a simplifyItem
, like:but actual rsult is:
so maybe we can add a exclude type option ( or named
keep
) on Deep type like:It can also resolve scene conflicts between users, such as one want recursive into
HTMLElemet
, anther one want keepHTMLElemet
Related comment: #651 (comment)
Related issue: #651
Upvote & Fund
The text was updated successfully, but these errors were encountered: