Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
2 replies
char

computed properties in zod

my api returns an object with dates as the key - is this possible to model in zod?

const response = {
  "2023-11-10": <value>,
  "2023-11-11": <value>
}


something like:

const schema = z.object({
  [z.string()]: <value>
})
Was this page helpful?