npm zod 1.1.2
v1.1.2

latest releases: 3.24.0-canary.20241107T043915, 3.24.0-canary.20241016T212913, 3.24.0-canary.20241016T212839...
4 years ago

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

Don't miss a new zod release

NewReleases is sending notifications on new releases.