Short version: I encountered a type error, and here is the link to the TS PLAYGROUND
I am looking to ensure type safety when creating zod schemas. To achieve this, I define the data type like so:
type Option = { id: number };
Using this type definition helps me specify the exact keys for my zod object schema, with the help of toZod to transform the datatype number
into z.number()
.