sindresorhus / type-fest

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

`PartialOnUndefined` with only 1 level deep #714

Open yvele opened 1 year ago

yvele commented 1 year ago

There is PartialOnUndefinedDeep:

But how can I make it work with only 1 level deep? 🤔

Upvote & Fund

Fund with Polar

sindresorhus commented 1 year ago

// @Emiyaaaaa

Emiyaaaaa commented 1 year ago

But how can I make it work with only 1 level deep? 🤔

What's your case? I can't seem to reproduce that.

kachkaev commented 4 months ago

+1 to @yvele. It’d be cool to have PartialOnUndefined and UndefinedOnPartial in addition to PartialOnUndefinedDeep and UndefinedOnPartialDeep. These would be more performant and can be used when type mismatch exists only on one level of depth. Happy to try a PR if these two types can be accepted in theory.

Emiyaaaaa commented 4 months ago

+1 to @yvele. It’d be cool to have PartialOnUndefined and UndefinedOnPartial in addition to PartialOnUndefinedDeep and UndefinedOnPartialDeep. These would be more performant and can be used when type mismatch exists only on one level of depth. Happy to try a PR if these two types can be accepted in theory.

Sure, go it.