File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
packages/zod/src/v4/classic Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1015,6 +1015,8 @@ export interface ZodArray<T extends core.$ZodType = core.$ZodType> extends ZodTy
1015
1015
nonempty ( params ?: string | core . $ZodCheckMinLengthParams ) : this;
1016
1016
max ( maxLength : number , params ?: string | core . $ZodCheckMaxLengthParams ) : this;
1017
1017
length ( len : number , params ?: string | core . $ZodCheckLengthEqualsParams ) : this;
1018
+
1019
+ unwrap ( ) : T ;
1018
1020
}
1019
1021
export const ZodArray : core . $constructor < ZodArray > = /*@__PURE__ */ core . $constructor ( "ZodArray" , ( inst , def ) => {
1020
1022
core . $ZodArray . init ( inst , def ) ;
@@ -1025,6 +1027,8 @@ export const ZodArray: core.$constructor<ZodArray> = /*@__PURE__*/ core.$constru
1025
1027
inst . nonempty = ( params ) => inst . check ( checks . minLength ( 1 , params ) ) ;
1026
1028
inst . max = ( maxLength , params ) => inst . check ( checks . maxLength ( maxLength , params ) ) ;
1027
1029
inst . length = ( len , params ) => inst . check ( checks . length ( len , params ) ) ;
1030
+
1031
+ inst . unwrap = ( ) => inst . element ;
1028
1032
} ) ;
1029
1033
1030
1034
export function array < T extends core . $ZodType > ( element : T , params ?: string | core . $ZodArrayParams ) : ZodArray < T > {
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ const result = z
11
11
} ) ;
12
12
13
13
console . log ( JSON . stringify ( result . error ! . issues , null , 2 ) ) ;
14
+
15
+ z . array ( z . string ( ) ) . def . element ;
You can’t perform that action at this time.
0 commit comments