Skip to content

Commit

Permalink
change the chaining order of nullish method
Browse files Browse the repository at this point in the history
Solves #1565
  • Loading branch information
p10ns11y authored Dec 15, 2022
1 parent ad43854 commit 0c0e495
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export abstract class ZodType<
return ZodNullable.create(this) as any;
}
nullish(): ZodNullable<ZodOptional<this>> {
return this.optional().nullable();
return this.nullable().optional();
}
array(): ZodArray<this> {
return ZodArray.create(this);
Expand Down

0 comments on commit 0c0e495

Please sign in to comment.