Skip to content

Commit 7ab1b3c

Browse files
committed
Do not continue parsing in ZodPipe if issues exists. Closes #4926.
1 parent 7dd7484 commit 7ab1b3c

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

packages/zod/src/v4/classic/tests/transform.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,6 @@ test("do not continue by default", () => {
346346
"code": "custom",
347347
"message": "custom error",
348348
"path": []
349-
},
350-
{
351-
"expected": "number",
352-
"code": "invalid_type",
353-
"path": [],
354-
"message": "Invalid input: expected number, received string"
355349
}
356350
]],
357351
"success": false,

packages/zod/src/v4/core/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ export const $ZodPipe: core.$constructor<$ZodPipe> = /*@__PURE__*/ core.$constru
34453445
});
34463446

34473447
function handlePipeResult(left: ParsePayload, def: $ZodPipeDef, ctx: ParseContext) {
3448-
if (util.aborted(left)) {
3448+
if (left.issues.length) {
34493449
return left;
34503450
}
34513451
return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);

0 commit comments

Comments
 (0)