Open sindresorhus opened 3 years ago
Maybe Required
could get an ExtendedRequired
or such as a compromise? Somewhat less pretty, but also somewhat more explicit in what it does, that it extends the built in one
Pretty sure we can just overwrite Required
to achieve what we want here.
By the way, recently I needed a different version of Required
that turned { foo?: string }
into { foo: string | undefined }
instead of { foo: string }
- I had to write my own, and had trouble choosing a good name as well. It would be great to have a name that could clearly show which case is it (although I agree most people will want the current behavior)
By the way, recently I needed a different version of Required that turned { foo?: string } into { foo: string | undefined } instead of { foo: string }
I'm curious what you needed it for?
See:
1af6d4a
(#157)SetOptional
would be renamed toOptional
. HoweverRequired
already exists, so not sure what to do about that? Can we make it an overload?Upvote & Fund