@@ -235,15 +235,13 @@ type IsSchemaTypeFromBuiltinClass<T> = T extends (typeof String)
235235 ? true
236236 : T extends Types . Decimal128
237237 ? true
238- : T extends Types . Int32
238+ : T extends Buffer
239239 ? true
240- : T extends Buffer
240+ : T extends NativeDate
241241 ? true
242- : T extends NativeDate
242+ : T extends ( typeof Schema . Types . Mixed )
243243 ? true
244- : T extends ( typeof Schema . Types . Mixed )
245- ? true
246- : IfEquals < T , Schema . Types . ObjectId , true , false > ;
244+ : IfEquals < T , Schema . Types . ObjectId , true , false > ;
247245
248246/**
249247 * @summary Resolve path type by returning the corresponding type.
@@ -306,21 +304,18 @@ type ResolvePathType<PathValueType, Options extends SchemaTypeOptions<PathValueT
306304 PathValueType extends 'decimal128' | 'Decimal128' | typeof Schema . Types . Decimal128 ? Types . Decimal128 :
307305 IfEquals < PathValueType , Schema . Types . Decimal128 > extends true ? Types . Decimal128 :
308306 IfEquals < PathValueType , Types . Decimal128 > extends true ? Types . Decimal128 :
309- PathValueType extends 'int32' | 'Int32' | typeof Schema . Types . Int32 ? Types . Int32 :
310- IfEquals < PathValueType , Schema . Types . Int32 > extends true ? Types . Int32 :
311- IfEquals < PathValueType , Types . Int32 > extends true ? Types . Int32 :
312- IfEquals < PathValueType , Schema . Types . BigInt > extends true ? bigint :
313- IfEquals < PathValueType , BigInt > extends true ? bigint :
314- PathValueType extends 'bigint' | 'BigInt' | typeof Schema . Types . BigInt | typeof BigInt ? bigint :
315- PathValueType extends 'uuid' | 'UUID' | typeof Schema . Types . UUID ? Buffer :
316- IfEquals < PathValueType , Schema . Types . UUID > extends true ? Buffer :
317- PathValueType extends MapConstructor | 'Map' ? Map < string , ResolvePathType < Options [ 'of' ] > > :
318- IfEquals < PathValueType , typeof Schema . Types . Map > extends true ? Map < string , ResolvePathType < Options [ 'of' ] > > :
319- PathValueType extends ArrayConstructor ? any [ ] :
320- PathValueType extends typeof Schema . Types . Mixed ? any :
321- IfEquals < PathValueType , ObjectConstructor > extends true ? any :
322- IfEquals < PathValueType , { } > extends true ? any :
323- PathValueType extends typeof SchemaType ? PathValueType [ 'prototype' ] :
324- PathValueType extends Record < string , any > ? ObtainDocumentType < PathValueType , any , { typeKey : TypeKey } > :
325- unknown ,
326- TypeHint > ;
307+ IfEquals < PathValueType , Schema . Types . BigInt > extends true ? bigint :
308+ IfEquals < PathValueType , BigInt > extends true ? bigint :
309+ PathValueType extends 'bigint' | 'BigInt' | typeof Schema . Types . BigInt | typeof BigInt ? bigint :
310+ PathValueType extends 'uuid' | 'UUID' | typeof Schema . Types . UUID ? Buffer :
311+ IfEquals < PathValueType , Schema . Types . UUID > extends true ? Buffer :
312+ PathValueType extends MapConstructor | 'Map' ? Map < string , ResolvePathType < Options [ 'of' ] > > :
313+ IfEquals < PathValueType , typeof Schema . Types . Map > extends true ? Map < string , ResolvePathType < Options [ 'of' ] > > :
314+ PathValueType extends ArrayConstructor ? any [ ] :
315+ PathValueType extends typeof Schema . Types . Mixed ? any :
316+ IfEquals < PathValueType , ObjectConstructor > extends true ? any :
317+ IfEquals < PathValueType , { } > extends true ? any :
318+ PathValueType extends typeof SchemaType ? PathValueType [ 'prototype' ] :
319+ PathValueType extends Record < string , any > ? ObtainDocumentType < PathValueType , any , { typeKey : TypeKey } > :
320+ unknown ,
321+ TypeHint > ;
0 commit comments