computed properties in zod
my api returns an object with dates as the key - is this possible to model in zod?
something like:
2 Replies
Yes you can use
z.record(keyType, valueType)
(https://zod.dev/?id=record-key-type)
z.record(z.string().min(1), z.number())
GitHub
TypeScript-first schema validation with static type inference
TypeScript-first schema validation with static type inference
thank you so much!