@@ -54,7 +54,7 @@ describe("Documentation", () => {
5454 v1 : {
5555 getSomething : defaultEndpointsFactory . build ( {
5656 input : z . object ( {
57- array : z . array ( z . number ( ) . int ( ) . positive ( ) ) . min ( 1 ) . max ( 3 ) ,
57+ array : z . array ( z . int ( ) . positive ( ) ) . min ( 1 ) . max ( 3 ) ,
5858 unlimited : z . array ( z . boolean ( ) ) ,
5959 transformer : z . string ( ) . transform ( ( str ) => str . length ) ,
6060 } ) ,
@@ -86,7 +86,7 @@ describe("Documentation", () => {
8686 optional : z . string ( ) . optional ( ) ,
8787 optDefault : z . string ( ) . optional ( ) . default ( "test" ) ,
8888 nullish : z . boolean ( ) . nullish ( ) ,
89- nuDefault : z . number ( ) . int ( ) . positive ( ) . nullish ( ) . default ( 123 ) ,
89+ nuDefault : z . int ( ) . positive ( ) . nullish ( ) . default ( 123 ) ,
9090 } ) ,
9191 output : z . object ( {
9292 nullable : z . string ( ) . nullable ( ) ,
@@ -124,14 +124,8 @@ describe("Documentation", () => {
124124 } ) ,
125125 output : z . object ( {
126126 and : z
127- . object ( {
128- five : z . number ( ) . int ( ) . gte ( 0 ) ,
129- } )
130- . and (
131- z . object ( {
132- six : z . string ( ) ,
133- } ) ,
134- ) ,
127+ . object ( { five : z . int ( ) . gte ( 0 ) } )
128+ . and ( z . object ( { six : z . string ( ) } ) ) ,
135129 } ) ,
136130 handler : async ( ) => ( {
137131 and : {
@@ -158,19 +152,11 @@ describe("Documentation", () => {
158152 method : "post" ,
159153 input : z . object ( {
160154 union : z . union ( [
161- z . object ( {
162- one : z . string ( ) ,
163- two : z . number ( ) . int ( ) . positive ( ) ,
164- } ) ,
165- z . object ( {
166- two : z . number ( ) . int ( ) . negative ( ) ,
167- three : z . string ( ) ,
168- } ) ,
155+ z . object ( { one : z . string ( ) , two : z . int ( ) . positive ( ) } ) ,
156+ z . object ( { two : z . int ( ) . negative ( ) , three : z . string ( ) } ) ,
169157 ] ) ,
170158 } ) ,
171- output : z . object ( {
172- or : z . string ( ) . or ( z . number ( ) . int ( ) . positive ( ) ) ,
173- } ) ,
159+ output : z . object ( { or : z . string ( ) . or ( z . int ( ) . positive ( ) ) } ) ,
174160 handler : async ( ) => ( {
175161 or : 554 ,
176162 } ) ,
@@ -223,10 +209,7 @@ describe("Documentation", () => {
223209 v1 : {
224210 getSomething : defaultEndpointsFactory . build ( {
225211 method : "post" ,
226- input : z . object ( {
227- one : z . string ( ) ,
228- two : z . number ( ) . int ( ) . positive ( ) ,
229- } ) ,
212+ input : z . object ( { one : z . string ( ) , two : z . int ( ) . positive ( ) } ) ,
230213 output : z . object ( {
231214 transform : z . string ( ) . transform ( ( str ) => str . length ) ,
232215 } ) ,
@@ -338,10 +321,10 @@ describe("Documentation", () => {
338321 doubleNegative : z . number ( ) . negative ( ) ,
339322 doubleLimited : z . number ( ) . min ( - 0.5 ) . max ( 0.5 ) ,
340323 int : z . int ( ) ,
341- intPositive : z . number ( ) . int ( ) . positive ( ) ,
342- intNegative : z . number ( ) . int ( ) . negative ( ) ,
343- intLimited : z . number ( ) . int ( ) . min ( - 100 ) . max ( 100 ) ,
344- zero : z . number ( ) . int ( ) . nonnegative ( ) . nonpositive ( ) . optional ( ) ,
324+ intPositive : z . int ( ) . positive ( ) ,
325+ intNegative : z . int ( ) . negative ( ) ,
326+ intLimited : z . int ( ) . min ( - 100 ) . max ( 100 ) ,
327+ zero : z . int ( ) . nonnegative ( ) . nonpositive ( ) . optional ( ) ,
345328 } ) ,
346329 output : z . object ( {
347330 bigint : z . bigint ( ) ,
@@ -406,11 +389,7 @@ describe("Documentation", () => {
406389 input : z . object ( {
407390 ofOne : z . tuple ( [ z . boolean ( ) ] ) ,
408391 ofStrings : z . tuple ( [ z . string ( ) , z . string ( ) . nullable ( ) ] ) ,
409- complex : z . tuple ( [
410- z . boolean ( ) ,
411- z . string ( ) ,
412- z . number ( ) . int ( ) . positive ( ) ,
413- ] ) ,
392+ complex : z . tuple ( [ z . boolean ( ) , z . string ( ) , z . int ( ) . positive ( ) ] ) ,
414393 } ) ,
415394 output : z . object ( {
416395 empty : z . tuple ( [ ] ) ,
@@ -456,7 +435,7 @@ describe("Documentation", () => {
456435 const string = z . preprocess ( ( arg ) => String ( arg ) , z . string ( ) ) ;
457436 const number = z . preprocess (
458437 ( arg ) => parseInt ( String ( arg ) , 16 ) ,
459- z . number ( ) . int ( ) . nonnegative ( ) ,
438+ z . int ( ) . nonnegative ( ) ,
460439 ) ;
461440 const boolean = z . preprocess ( ( arg ) => ! ! arg , z . boolean ( ) ) ;
462441 const spec = new Documentation ( {
0 commit comments