Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] add notice about strictObject #2512

Closed
wants to merge 1 commit into from

Conversation

cupcakearmy
Copy link

Found strictObject in this ticket and i wondered if i missed it in the docs, but it cannot be found.

@netlify
Copy link

netlify bot commented Jun 19, 2023

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a64f385
🔍 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...

QR Code

Use your smartphone camera to open QR code link.

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

@cupcakearmy cupcakearmy changed the title add notice about strictObject [docs] add notice about strictObject Jun 19, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

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.

@stale stale bot added the stale No activity in last 60 days label Sep 17, 2023
@cupcakearmy
Copy link
Author

Def not stale my bot

@stale stale bot removed the stale No activity in last 60 days label Sep 20, 2023
@vixalien
Copy link

In the issue, I also saw that it is "the recommended approach". I just find it weird that it's not recommended anywhere 🤔

@cupcakearmy
Copy link
Author

@colinhacks ping ❤️

@colinhacks
Copy link
Owner

colinhacks commented Mar 22, 2024

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.

@colinhacks colinhacks closed this Mar 22, 2024
@cupcakearmy cupcakearmy deleted the patch-1 branch March 24, 2024 19:55
@cupcakearmy
Copy link
Author

Sure :)
Global option would be reaaallyy nice!
Thanks for the time, so you on v4 🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants