angrybacon - Hello 👋 apologies in advance if I...
Hello 👋 apologies in advance if I missed it in the issues or documentation
Are named tuple members a thing in Zod?
Solution:Jump to solution
https://zod.dev/?id=tuples
I'm guessing to add names, you might need to pass a generic type to
z.tuple
. Alternatively you could use a refine, something like this (haven't checked the syntax, so could be slightly off):
```ts...GitHub
TypeScript-first schema validation with static type inference
TypeScript-first schema validation with static type inference
2 Replies
Solution
https://zod.dev/?id=tuples
I'm guessing to add names, you might need to pass a generic type to
z.tuple
. Alternatively you could use a refine, something like this (haven't checked the syntax, so could be slightly off):
GitHub
TypeScript-first schema validation with static type inference
TypeScript-first schema validation with static type inference
That seems pretty verbose but can't think of any other way, thanks I'll try it out