File tree 4 files changed +18
-3
lines changed
4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,10 @@ export abstract class ZodType<
371
371
refinement : ( arg : Output , ctx : RefinementCtx ) => arg is RefinedOutput
372
372
) : ZodEffects < this, RefinedOutput , Input > ;
373
373
superRefine (
374
- refinement : ( arg : Output , ctx : RefinementCtx ) => void | Promise < void >
374
+ refinement : ( arg : Output , ctx : RefinementCtx ) => void
375
+ ) : ZodEffects < this, Output , Input > ;
376
+ superRefine (
377
+ refinement : ( arg : Output , ctx : RefinementCtx ) => Promise < void >
375
378
) : ZodEffects < this, Output , Input > ;
376
379
superRefine (
377
380
refinement : ( arg : Output , ctx : RefinementCtx ) => unknown | Promise < unknown >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " zod" ,
3
- "version" : " 3.22.1 " ,
3
+ "version" : " 3.22.2 " ,
4
4
"author" : " Colin McDonnell <colin@colinhacks.com>" ,
5
5
"repository" : {
6
6
"type" : " git" ,
Original file line number Diff line number Diff line change 1
1
import { z } from "./src" ;
2
2
3
3
z ;
4
+
5
+ const schema = z . object ( {
6
+ name : z . string ( ) ,
7
+ value : z . string ( ) ,
8
+ } ) ;
9
+
10
+ const schemaRefine = schema . superRefine ( async ( val , _ctx ) => {
11
+ return val . value !== "INVALID" ;
12
+ } ) ;
Original file line number Diff line number Diff line change @@ -371,7 +371,10 @@ export abstract class ZodType<
371
371
refinement : ( arg : Output , ctx : RefinementCtx ) => arg is RefinedOutput
372
372
) : ZodEffects < this, RefinedOutput , Input > ;
373
373
superRefine (
374
- refinement : ( arg : Output , ctx : RefinementCtx ) => void | Promise < void >
374
+ refinement : ( arg : Output , ctx : RefinementCtx ) => void
375
+ ) : ZodEffects < this, Output , Input > ;
376
+ superRefine (
377
+ refinement : ( arg : Output , ctx : RefinementCtx ) => Promise < void >
375
378
) : ZodEffects < this, Output , Input > ;
376
379
superRefine (
377
380
refinement : ( arg : Output , ctx : RefinementCtx ) => unknown | Promise < unknown >
You can’t perform that action at this time.
0 commit comments