diff --git a/src/types.ts b/src/types.ts index ef27ec585..ce54bc838 100644 --- a/src/types.ts +++ b/src/types.ts @@ -396,7 +396,7 @@ export abstract class ZodType< return ZodNullable.create(this) as any; } nullish(): ZodNullable> { - return this.optional().nullable(); + return this.nullable().optional(); } array(): ZodArray { return ZodArray.create(this);