zod
zod copied to clipboard
feat: Add extra coercions
This PR adds the following extra coercions:
-
Set
->Array
inZodArray
-
Set
->Array
inZodTuple
-
Array
->Set
inZodSet
-
Object
->Map
inZodMap
-
Map
->Object
inZodObject
Deploy Preview for guileless-rolypoly-866f8a ready!
Built without sensitive environment variables
Name | Link |
---|---|
Latest commit | 3d5eba00ff1572ad0d2e378beafb6205e08563bb |
Latest deploy log | https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/63a3d5714715cc000880eb9c |
Deploy Preview | https://deploy-preview-1736--guileless-rolypoly-866f8a.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
This is interesting but not worth the squeeze, in my opinion. We need to be conservative about what sorts of features make it into core as Zod gets larger, and this use case feels very niche and edge casey. It opens up Zod to a bunch of feature requests of the form "Why isn't there a coercion mode from X to Y?". Keeping z.coerce
as primitive-only is the best way to draw a line in the sand.
This is interesting but not worth the squeeze, in my opinion. We need to be conservative about what sorts of features make it into core as Zod gets larger, and this use case feels very niche and edge casey. It opens up Zod to a bunch of feature requests of the form "Why isn't there a coercion mode from X to Y?". Keeping
z.coerce
as primitive-only is the best way to draw a line in the sand.
Ok, I get what you are saying and agree with the decision.
Closing PR.