@@ -39,19 +39,24 @@ export type InferValueType<T extends DefinitionType> =
3939
4040 // Handle direct array patterns
4141 : T extends Array < infer ChildType extends Constructor > ? InstanceType < ChildType > [ ]
42+ : T extends Array < infer ChildType extends RawPrimitiveType > ? InferValueType < ChildType > [ ] // primitive types
4243 : T extends Array < infer ChildType > ? ( ChildType extends Record < string | number , string | number > ? ChildType [ keyof ChildType ] [ ] : ChildType [ ] ) // TS ENUM
4344
4445 // Handle collection object patterns
4546 : T extends { array : infer ChildType extends Constructor } ? InstanceType < ChildType > [ ]
47+ : T extends { array : infer ChildType extends RawPrimitiveType } ? InferValueType < ChildType > [ ] // primitive types
4648 : T extends { array : infer ChildType } ? ( ChildType extends Record < string | number , string | number > ? ChildType [ keyof ChildType ] [ ] : ChildType [ ] ) // TS ENUM
4749
4850 : T extends { map : infer ChildType extends Constructor } ? MapSchema < InstanceType < ChildType > >
51+ : T extends { map : infer ChildType extends RawPrimitiveType } ? MapSchema < InferValueType < ChildType > > // primitive types
4952 : T extends { map : infer ChildType } ? ( ChildType extends Record < string | number , string | number > ? MapSchema < ChildType [ keyof ChildType ] > : MapSchema < ChildType > ) // TS ENUM
5053
5154 : T extends { set : infer ChildType extends Constructor } ? SetSchema < InstanceType < ChildType > >
55+ : T extends { set : infer ChildType extends RawPrimitiveType } ? SetSchema < InferValueType < ChildType > > // primitive types
5256 : T extends { set : infer ChildType } ? ( ChildType extends Record < string | number , string | number > ? SetSchema < ChildType [ keyof ChildType ] > : SetSchema < ChildType > ) // TS ENUM
5357
5458 : T extends { collection : infer ChildType extends Constructor } ? CollectionSchema < InstanceType < ChildType > >
59+ : T extends { collection : infer ChildType extends RawPrimitiveType } ? CollectionSchema < InferValueType < ChildType > > // primitive types
5560 : T extends { collection : infer ChildType } ? ( ChildType extends Record < string | number , string | number > ? CollectionSchema < ChildType [ keyof ChildType ] > : CollectionSchema < ChildType > ) // TS ENUM
5661
5762 // Handle direct types
0 commit comments