Skip to content
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 SetNonNullable type #228

Open
sindresorhus opened this issue Jul 8, 2021 · 6 comments
Open

Add SetNonNullable type #228

sindresorhus opened this issue Jul 8, 2021 · 6 comments
Labels
help wanted Extra attention is needed type addition

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Jul 8, 2021

#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.
Fund with Polar
@falkenhawk
Copy link

looking forward to this to be included 👍

@sindresorhus
Copy link
Owner Author

#245

@joealden
Copy link
Contributor

@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?

@sindresorhus
Copy link
Owner Author

@joealden It should work like NonNullable, so not deal with property optionality.

@joealden
Copy link
Contributor

joealden commented Sep 6, 2022

I believe this can be closed now that #431 has been merged?

@kachkaev
Copy link

yeah this can be closed I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type addition
Projects
None yet
Development

No branches or pull requests

4 participants