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

`PartialDeep` make `Date` internal structure partial

Open caiorhian opened this issue 1 year ago • 2 comments

I've noticed that when you apply PartialDeep to something containing Date it makes the Date internal structure partial, which causes some errors when combining it with zod validations for instance.

Should it skip internal JS classes like Date while making something partially deep?

I've found https://github.com/sindresorhus/type-fest/pull/342, but I still see the issue on version v4.4.0, might be a regression?

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

caiorhian avatar Oct 20 '23 18:10 caiorhian

I've found https://github.com/sindresorhus/type-fest/pull/342, but I still see the issue on version v4.4.0, might be a regression?

I think that one only handled Date as the input object, not as a deep value.

sindresorhus avatar Oct 20 '23 20:10 sindresorhus

I've noticed that when you apply PartialDeep to something containing Date it makes the Date internal structure partial

Can you provide your test cases? I seem can't reproduce that.

Emiyaaaaa avatar Oct 21 '23 15:10 Emiyaaaaa