zod
zod copied to clipboard
[docs] add notice about strictObject
Found strictObject in this ticket and i wondered if i missed it in the docs, but it cannot be found.
Deploy Preview for guileless-rolypoly-866f8a ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | a64f385fd0fbca5986950131c6df579aeacad167 |
| Latest deploy log | https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/6490124a0980660008f15830 |
| Deploy Preview | https://deploy-preview-2512--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 issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Def not stale my bot
In the issue, I also saw that it is "the recommended approach". I just find it weird that it's not recommended anywhere 🤔
@colinhacks ping ❤️
I appreciate the PR, though tbh I'd prefer people not use this. It opens up the door to a bunch of top-level APIs that are better kept as methods (e.g. z.optionalString()). I generally don't like having multiple ways of achieving the same thing.
Also, there will likely be a way to configure this setting globally in Zod 4, which solves the core problem better than z.strictObject() anyway.
In the issue, I also saw that it is "the recommended approach". I just find it weird that it's not recommended anywhere 🤔
cc @vixalien It is the recommended approach for achieving the OP's suggestion of a deepStrict(), not in the general case.
Sure :) Global option would be reaaallyy nice! Thanks for the time, so you on v4 🤘