Skip to content

Commit

Permalink
fix: nonEmpty preprocess logic to support breaking change in [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed Oct 1, 2024
1 parent e65558c commit ac99426
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export function nonEmpty(schema: z.ZodString): z.ZodType<string, z.ZodTypeDef, u

if (!result.success) {
result.error.issues.forEach((issue) => {
ctx.addIssue(issue);
// why fatal = true? see: https://github.com/colinhacks/zod/pull/2912#issuecomment-2010989328
ctx.addIssue({ ...issue, fatal: true });
});
return z.NEVER;
}
Expand Down

0 comments on commit ac99426

Please sign in to comment.