zod icon indicating copy to clipboard operation
zod copied to clipboard

Bugfix: z.record().parse should not filter out undefined values

Open raik-casimiro opened this issue 5 months ago • 1 comments

When calling .parse on z.record( z.any() ) we should not filter out undefined values. Add the optional 'alwaysSet' to the z.record pairs before passing them to mergeObject to maintain undefined values.

This solves issue #3197

raik-casimiro avatar Feb 17 '24 02:02 raik-casimiro

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
Latest commit ed9d10bf6b05c9d15d1f880a766425155fb1ecf8
Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/65d01bad2e8906000824cd5e
Deploy Preview https://deploy-preview-3251--guileless-rolypoly-866f8a.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Feb 17 '24 02:02 netlify[bot]

Thanks! Great PR.

colinhacks avatar Apr 16 '24 20:04 colinhacks

This has landed in Zod 3.23.

https://github.com/colinhacks/zod/releases/tag/v3.23.0

colinhacks avatar Apr 21 '24 22:04 colinhacks