File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -127,3 +127,10 @@ function HandlesAny() {
127127 type ActualNested = InferRawDocType < Record < string , any > > ;
128128 expectType < { [ x : string ] : any } > ( { } as ActualNested ) ;
129129}
130+
131+ function gh15699 ( ) {
132+ const schema = { unTypedArray : [ ] } as const ;
133+
134+ type TSchema = InferRawDocType < typeof schema > ;
135+ expectType < any [ ] | null | undefined > ( { } as unknown as TSchema [ 'unTypedArray' ] ) ;
136+ }
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ declare module 'mongoose' {
6060 [ PathValueType ] extends [ neverOrAny ] ? PathValueType
6161 : PathValueType extends Schema ? InferSchemaType < PathValueType >
6262 : PathValueType extends ReadonlyArray < infer Item > ?
63- Item extends never ? any [ ]
63+ [ Item ] extends [ never ] ? any [ ]
6464 : Item extends Schema ?
6565 // If Item is a schema, infer its type.
6666 Array < InferSchemaType < Item > >
You can’t perform that action at this time.
0 commit comments