Kas.st - Hi everyone, I have a schema with an e...
Hi everyone, I have a schema with an enum:
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:Jump to solution
```ts
// Type level
type EnumValue = typeof schema["shape"]["foo"]["options"][number];
// Runtime (with types also)...
1 Reply
Solution