sindresorhus / type-fest

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

Make the second argument to RequireAllOrNone optional #847

Closed roryabraham closed 2 months ago

roryabraham commented 6 months ago

Minor suggestion for an enhancement - make the second argument to RequireAllOrNone optional:

i.e: RequireAllOrNone<MyType> would be functionally equivalent to RequireAllOrNone<MyType, keyof MyType>

Upvote & Fund

Fund with Polar

sindresorhus commented 6 months ago

Makes sense to me.

@tommy-mitchell Any reason you went with never? I noticed you used key T in your issue: https://github.com/sindresorhus/type-fest/issues/652#issue-1823667703

tommy-mitchell commented 3 months ago

I didn't add the never constraint, that was introduced when RequireAllOrNone was created in #254.

We're just inconsistent in general with our RequireX types - some have an optional second parameter, others don't. I think all of them should, personally.

sindresorhus commented 3 months ago

Alright. Let's do it.

roryabraham commented 2 months ago

Thanks all! 🚀