Skip to content

How to have .optional() survive during transform() #3299

Answered by JacobWeisenburger
sp88011 asked this question in Q&A
Discussion options

You must be logged in to vote

In zod, an optional property means that it could be undefined. I understand that it is confusing, because in typescript undefined and optional are 2 similar things, but not the same.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by JacobWeisenburger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3291 on March 04, 2024 15:43.