type-fest
type-fest copied to clipboard
Add `SetNonNullable` type
https://github.com/sindresorhus/type-fest/pull/199
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- The funding will be given to active contributors.
- Thank you in advance for helping prioritize & fund our backlog.
looking forward to this to be included 👍
https://github.com/sindresorhus/type-fest/pull/245
@sindresorhus do you think this type needs to deal with optionality? We have the following type in our codebase at work:
type SetNonNullable<
BaseType,
KeysToSet extends keyof BaseType = keyof BaseType
> = {
[Key in keyof BaseType]: Key extends KeysToSet
? NonNullable<BaseType[Key]>
: BaseType[Key];
};
So I'm wondering if we'd all be happier with the naming of this if it more closely followed the behaviour of NonNullable
?
@joealden It should work like NonNullable
, so not deal with property optionality.
I believe this can be closed now that https://github.com/sindresorhus/type-fest/pull/431 has been merged?
yeah this can be closed I guess