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