Named tuple / array with literal strings #349
-
I want to validate against the following array: const schema = v.tuple([v.literal('ens'), v.literal('primary-list'), v.literal('following'), v.literal('followers')]) also what is the equivalent of this https://zod.dev/?id=default |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Jan 4, 2024
Replies: 1 comment
-
Yes, this looks good to me. With Valibot you use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
o-az
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, this looks good to me. With Valibot you use
optional
with a default argument as the second parameter.