type-fest icon indicating copy to clipboard operation
type-fest copied to clipboard

`PartialOnUndefined` with only 1 level deep

Open yvele opened this issue 1 year ago • 4 comments

There is PartialOnUndefinedDeep:

  • https://github.com/sindresorhus/type-fest/issues/399
  • https://github.com/sindresorhus/type-fest/pull/426

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

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

yvele avatar Oct 19 '23 14:10 yvele

// @Emiyaaaaa

sindresorhus avatar Oct 19 '23 14:10 sindresorhus

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

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

Emiyaaaaa avatar Oct 19 '23 17:10 Emiyaaaaa

+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.

kachkaev avatar Jul 03 '24 12:07 kachkaev

+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.

Emiyaaaaa avatar Jul 04 '24 09:07 Emiyaaaaa