Releases: colinhacks/zod
Releases · colinhacks/zod
v1.1.2
Implemented ZodRecord.
Usage:
const myRecord = z.record(z.object({ name: z.string() }));
type myRecord = z.TypeOf<typeof myRecord>
// => { [k: string]: { name: string } }
myRecord.parse({
asdf: { name: 'Bruce' },
1234: { name: 'Barry' },
}) // passes
myRecord.parse({
id1: true
}) // TypeError
myRecord.parse({
id1: true
} as any) // throws