@@ -29,7 +29,9 @@ export function any(): Struct<any, null> {
2929 * and it is preferred to using `array(any())`.
3030 */
3131
32- export function array < T extends Struct < any > > ( Element : T ) : Struct < Infer < T > [ ] , T , InferUncoerced < T > [ ] >
32+ export function array < T extends Struct < any > > (
33+ Element : T
34+ ) : Struct < Infer < T > [ ] , T , InferUncoerced < T > [ ] >
3335export function array ( ) : Struct < unknown [ ] , undefined >
3436export function array < T extends Struct < any > > ( Element ?: T ) : any {
3537 return new Struct ( {
@@ -172,7 +174,11 @@ export function integer(): Struct<number, null> {
172174
173175export function intersection < A extends AnyStruct , B extends AnyStruct [ ] > (
174176 Structs : [ A , ...B ]
175- ) : Struct < Infer < A > & UnionToIntersection < InferStructTuple < B > [ number ] > , null , InferUncoerced < A > & UnionToIntersection < InferStructTupleUncoerced < B > [ number ] > > {
177+ ) : Struct <
178+ Infer < A > & UnionToIntersection < InferStructTuple < B > [ number ] > ,
179+ null ,
180+ InferUncoerced < A > & UnionToIntersection < InferStructTupleUncoerced < B > [ number ] >
181+ > {
176182 return new Struct ( {
177183 type : 'intersection' ,
178184 schema : null ,
@@ -264,7 +270,9 @@ export function never(): Struct<never, null> {
264270 * Augment an existing struct to allow `null` values.
265271 */
266272
267- export function nullable < T , S , C > ( struct : Struct < T , S , C > ) : Struct < T | null , S > {
273+ export function nullable < T , S , C > (
274+ struct : Struct < T , S , C >
275+ ) : Struct < T | null , S > {
268276 return new Struct ( {
269277 ...struct ,
270278 validator : ( value , ctx ) => value === null || struct . validator ( value , ctx ) ,
@@ -434,7 +442,11 @@ export function string(): Struct<string, null> {
434442
435443export function tuple < A extends AnyStruct , B extends AnyStruct [ ] > (
436444 Structs : [ A , ...B ]
437- ) : Struct < [ Infer < A > , ...InferStructTuple < B > ] , null , [ InferUncoerced < A > , ...InferStructTupleUncoerced < B > ] > {
445+ ) : Struct <
446+ [ Infer < A > , ...InferStructTuple < B > ] ,
447+ null ,
448+ [ InferUncoerced < A > , ...InferStructTupleUncoerced < B > ]
449+ > {
438450 const Never = never ( )
439451
440452 return new Struct ( {
@@ -496,7 +508,11 @@ export function type<S extends ObjectSchema>(
496508
497509export function union < A extends AnyStruct , B extends AnyStruct [ ] > (
498510 Structs : [ A , ...B ]
499- ) : Struct < Infer < A > | InferStructTuple < B > [ number ] , null , InferUncoerced < A > | InferStructTupleUncoerced < B > [ number ] > {
511+ ) : Struct <
512+ Infer < A > | InferStructTuple < B > [ number ] ,
513+ null ,
514+ InferUncoerced < A > | InferStructTupleUncoerced < B > [ number ]
515+ > {
500516 const description = Structs . map ( ( s ) => s . type ) . join ( ' | ' )
501517 return new Struct ( {
502518 type : 'union' ,
0 commit comments