File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4264,8 +4264,10 @@ export class ZodEffects<
42644264
42654265 const effect = this . _def . effect || null ;
42664266
4267+ let hasIssue = false ;
42674268 const checkCtx : RefinementCtx = {
42684269 addIssue : ( arg : IssueData ) => {
4270+ hasIssue = true ;
42694271 addIssueToContext ( ctx , arg ) ;
42704272 if ( arg . fatal ) {
42714273 status . abort ( ) ;
@@ -4282,7 +4284,7 @@ export class ZodEffects<
42824284
42834285 if ( effect . type === "preprocess" ) {
42844286 const processed = effect . transform ( ctx . data , checkCtx ) ;
4285- if ( ctx . common . issues . length ) {
4287+ if ( hasIssue ) {
42864288 return {
42874289 status : "dirty" ,
42884290 value : ctx . data ,
Original file line number Diff line number Diff line change @@ -4264,8 +4264,10 @@ export class ZodEffects<
42644264
42654265 const effect = this . _def . effect || null ;
42664266
4267+ let hasIssue = false ;
42674268 const checkCtx : RefinementCtx = {
42684269 addIssue : ( arg : IssueData ) => {
4270+ hasIssue = true ;
42694271 addIssueToContext ( ctx , arg ) ;
42704272 if ( arg . fatal ) {
42714273 status . abort ( ) ;
@@ -4282,7 +4284,7 @@ export class ZodEffects<
42824284
42834285 if ( effect . type === "preprocess" ) {
42844286 const processed = effect . transform ( ctx . data , checkCtx ) ;
4285- if ( ctx . common . issues . length ) {
4287+ if ( hasIssue ) {
42864288 return {
42874289 status : "dirty" ,
42884290 value : ctx . data ,
You can’t perform that action at this time.
0 commit comments