sindresorhus / type-fest

A collection of essential TypeScript types
Creative Commons Zero v1.0 Universal
14.34k stars 544 forks source link

Rename `SetOptional` and `SetRequired`? #171

Open sindresorhus opened 3 years ago

sindresorhus commented 3 years ago

See: 1af6d4a (#157)

SetOptional would be renamed to Optional. However Required already exists, so not sure what to do about that? Can we make it an overload?

Upvote & Fund

Fund with Polar

voxpelli commented 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

kainiedziela commented 3 years ago

Pretty sure we can just overwrite Required to achieve what we want here.

papb commented 3 years ago

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)

sindresorhus commented 3 years ago

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?