.optional to accept a boolean parameter #3811
justin-hackin
started this conversation in
Ideas
Replies: 1 comment
-
|
It looks like a solution to this problem was already discussed here. I realized this feature request is not practical because you can't have accurate typing with runtime variables determining shape of the data. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using zod for env vars. I want my object property to be optional if it's a dev build because then I am omitting features like error tracking and analytics. I thought it would be really nice if the
optionalfunction accepted a boolean that, when true, would make the field optional but otherwise leave as is. It seems a little bit clumsy to have to create a helper function for this. Is there already an elegant way to deal with this case though?Beta Was this translation helpful? Give feedback.
All reactions