Is there a more efficient way to define a Zod schema with nullable properties without repeating the nullable() method for each property? Currently, I have defined it as shown below:
const MyObjectSchema = z
.object({
p1: z.string().nullable(),
p2: z.number().nullable(),
p3: z.boolean().nullable(),
p4: z.date().nullable(),
p5: z.symbol().nullable(),
})
.partial();
Note: Using .Partial does not make object fields nullable.