Relative Content

Tag Archive for zod

Convert a zod object schema to a record type

const definition = z.object({ a: z.string(), b: z.number(), }) I want to have a type like this { a?: string, b?: number, } I don’t want to convert the object schema to make every key optional because it’s used as a definition map to match a sub schema to a key. So what I really […]