@@ -1527,45 +1527,15 @@ export const $ZodArray: core.$constructor<$ZodArray> = /*@__PURE__*/ core.$const
1527
1527
type OptionalOutSchema = { _zod : { optout : "optional" } } ;
1528
1528
type OptionalInSchema = { _zod : { optin : "optional" } } ;
1529
1529
1530
- export type $InferObjectOutputFallback <
1531
- T extends $ZodLooseShape ,
1532
- Extra extends Record < string , unknown > ,
1533
- > = string extends keyof T
1534
- ? object
1535
- : keyof ( T & Extra ) extends never
1536
- ? Record < string , never >
1537
- : util . Prettify <
1538
- {
1539
- // this is a simplified fallback type
1540
- // there is no support for key optionality
1541
- - readonly [ k in keyof T ] : core . output < T [ k ] > ;
1542
- } & Extra
1543
- > ;
1544
-
1545
- export type $InferObjectInputFallback <
1546
- T extends $ZodLooseShape ,
1547
- Extra extends Record < string , unknown > ,
1548
- > = string extends keyof T
1549
- ? object
1550
- : keyof ( T & Extra ) extends never
1551
- ? Record < string , never >
1552
- : util . Prettify <
1553
- {
1554
- // this is a simplified fallback type
1555
- // there is no support for key optionality
1556
- - readonly [ k in keyof T ] : core . input < T [ k ] > ;
1557
- } & Extra
1558
- > ;
1559
-
1560
1530
export type $InferObjectOutput < T extends $ZodLooseShape , Extra extends Record < string , unknown > > = string extends keyof T
1561
1531
? object
1562
1532
: keyof ( T & Extra ) extends never
1563
1533
? Record < string , never >
1564
1534
: util . Prettify <
1565
1535
{
1566
- - readonly [ k in keyof T as T [ k ] extends OptionalOutSchema ? never : k ] : core . output < T [ k ] > ;
1536
+ - readonly [ k in keyof T as T [ k ] extends OptionalOutSchema ? never : k ] : T [ k ] [ "_zod" ] [ "output" ] ;
1567
1537
} & {
1568
- - readonly [ k in keyof T as T [ k ] extends OptionalOutSchema ? k : never ] ?: core . output < T [ k ] > ;
1538
+ - readonly [ k in keyof T as T [ k ] extends OptionalOutSchema ? k : never ] ?: T [ k ] [ "_zod" ] [ "output" ] ;
1569
1539
} & Extra
1570
1540
> ;
1571
1541
@@ -1575,9 +1545,9 @@ export type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<str
1575
1545
? Record < string , never >
1576
1546
: util . Prettify <
1577
1547
{
1578
- - readonly [ k in keyof T as T [ k ] extends OptionalInSchema ? never : k ] : core . input < T [ k ] > ;
1548
+ - readonly [ k in keyof T as T [ k ] extends OptionalInSchema ? never : k ] : T [ k ] [ "_zod" ] [ "input" ] ;
1579
1549
} & {
1580
- - readonly [ k in keyof T as T [ k ] extends OptionalInSchema ? k : never ] ?: core . input < T [ k ] > ;
1550
+ - readonly [ k in keyof T as T [ k ] extends OptionalInSchema ? k : never ] ?: T [ k ] [ "_zod" ] [ "input" ] ;
1581
1551
} & Extra
1582
1552
> ;
1583
1553
@@ -1874,6 +1844,7 @@ export const $ZodObject: core.$constructor<$ZodObject> = /*@__PURE__*/ core.$con
1874
1844
////////// ///////////
1875
1845
/////////////////////////////////////////
1876
1846
/////////////////////////////////////////
1847
+ // use generic to distribute union types
1877
1848
export type $InferUnionOutput < T extends SomeType > = T extends any ? core . output < T > : never ;
1878
1849
export type $InferUnionInput < T extends SomeType > = T extends any ? core . input < T > : never ;
1879
1850
export interface $ZodUnionDef < Options extends readonly SomeType [ ] = readonly $ZodType [ ] > extends $ZodTypeDef {
0 commit comments