Z
Zod8mo ago
Kas.st

Kas.st - Hi everyone, I have a schema with an e...

Hi everyone, I have a schema with an enum:
const schema = z.object({
foo: z.enum(["foo", "bar", "baz"])
})
const schema = z.object({
foo: z.enum(["foo", "bar", "baz"])
})
how can I get all the valid values from the enum? I saw that theres a .options() method on z.enum but I dont know how I'll get to that if I only have the schema?
Solution:
Message Not Public
Sign In & Join Server To View
Jump to solution
1 Reply
Solution
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View