Zod array with valid values

How can I make a zod array with certain valid values. I know I could do this with refine, but generally try to avoid that if possible to get better types.

Thanks!
Solution
This seems to work 👍

z.array(z.union([z.literal("NY"), z.literal("FL")]))
Was this page helpful?