Zod default without making input type optional #3770
Unanswered
BrendanC23
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking for a way to have a default value while keeping the input type unchanged. I want the default value to take effect when
parse
is called, but not when explicitly defining an object using the type.I've also looked at
catch()
, but that makes the input typeunknown
.Is there a way to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions