Replies: 5 comments 3 replies
-
an argument could be made for |
Beta Was this translation helpful? Give feedback.
-
I would be interested in seeing |
Beta Was this translation helpful? Give feedback.
-
I ran into the same issue. Here is what I did for a recursive strict schema:
|
Beta Was this translation helpful? Give feedback.
-
Here's a more general and correct utility that also handles optionals, nullables, and tuples. It's based on the fact that
|
Beta Was this translation helpful? Give feedback.
-
I have objects with junk I don't want to type, but also need to preserve, and need a deepPassthrough() |
Beta Was this translation helpful? Give feedback.
-
Say we have the following schema:
When we call
.strict().parse()
, it won't affect thename
schema, or deeper schemas on that matter, so.parse
won't throw an error:Perhaps an
.deepStrict
method could be added, so Zod can turn every inner schema strict, so we don't have to define it in every single object, or do a function that alters the schema manually.Is this something doable or is there an existing workaround for that?
Beta Was this translation helpful? Give feedback.
All reactions