sindresorhus / type-fest

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

`PartialOnUndefined` with only 1 level deep #714

Open yvele opened 8 months ago

yvele commented 8 months ago

There is PartialOnUndefinedDeep:

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

Upvote & Fund

Fund with Polar

sindresorhus commented 8 months ago

// @Emiyaaaaa

Emiyaaaaa commented 8 months 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 days 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 3 days 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.