How can I allow all literal types? #469
-
type Vendor = 'google' | 's3'
const vendor = v.literal<Vendor>('google') What's the best way here to let me type any (or, better yet, all) of the possible values from The implementation could use an array or something like that? Or multiple args? |
Beta Was this translation helpful? Give feedback.
Answered by
fabian-hiller
Mar 5, 2024
Replies: 1 comment
-
I would recommend import * as v from 'valibot';
const Vendor = v.picklist(['google', 's3']); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fabian-hiller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would recommend
picklist
. Check it out in our playground.