Commit 57540aa 1 parent 1a1a2f2 commit 57540aa Copy full SHA for 57540aa
File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1528,15 +1528,17 @@ declare module 'mongoose' {
1528
1528
U :
1529
1529
T extends ReadonlyArray < infer U > ? U : T ;
1530
1530
1531
+ type AnyArray < T > = T [ ] | ReadonlyArray < T > ;
1532
+
1531
1533
export class SchemaTypeOptions < T > {
1532
1534
type ?:
1533
1535
T extends string | number | boolean | NativeDate | Function ? SchemaDefinitionWithBuiltInClass < T > :
1534
1536
T extends Schema < any , any > ? T :
1535
- T extends object [ ] ? ( Schema < Unpacked < T > > [ ] | ReadonlyArray < Schema < Unpacked < T > > > | Schema < Document & Unpacked < T > > [ ] | ReadonlyArray < Schema < Document & Unpacked < T > > > ) :
1536
- T extends string [ ] ? ( SchemaDefinitionWithBuiltInClass < string > [ ] | ReadonlyArray < SchemaDefinitionWithBuiltInClass < string > > ) :
1537
- T extends number [ ] ? ( SchemaDefinitionWithBuiltInClass < number > [ ] | ReadonlyArray < SchemaDefinitionWithBuiltInClass < number > > ) :
1538
- T extends boolean [ ] ? ( SchemaDefinitionWithBuiltInClass < boolean > [ ] | ReadonlyArray < SchemaDefinitionWithBuiltInClass < boolean > > ) :
1539
- T extends Function [ ] ? ( SchemaDefinitionWithBuiltInClass < Function > [ ] | ReadonlyArray < SchemaDefinitionWithBuiltInClass < Function > > ) :
1537
+ T extends object [ ] ? ( AnyArray < Schema < Unpacked < T > > > | AnyArray < Schema < Document & Unpacked < T > > > | AnyArray < SchemaDefinition < Unpacked < T > > > ) :
1538
+ T extends string [ ] ? AnyArray < SchemaDefinitionWithBuiltInClass < string > > :
1539
+ T extends number [ ] ? AnyArray < SchemaDefinitionWithBuiltInClass < number > > :
1540
+ T extends boolean [ ] ? AnyArray < SchemaDefinitionWithBuiltInClass < boolean > > :
1541
+ T extends Function [ ] ? AnyArray < SchemaDefinitionWithBuiltInClass < Function > > :
1540
1542
T | typeof SchemaType | Schema < any , any , any > | SchemaDefinition < T > ;
1541
1543
1542
1544
/** Defines a virtual with the given name that gets/sets this path. */
You can’t perform that action at this time.
0 commit comments