Skip to content

Commit 197d299

Browse files
committed
perf(types): remove unnecessary infer M re: #10349
1 parent 7ed781c commit 197d299

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

types/inferschematype.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ declare module 'mongoose' {
4545
* @param {TSchema} TSchema A generic of schema type instance.
4646
* @param {alias} alias Targeted generic alias.
4747
*/
48-
type ObtainSchemaGeneric<TSchema, alias extends 'EnforcedDocType' | 'M' | 'TInstanceMethods' | 'TQueryHelpers' | 'TVirtuals' | 'TStaticMethods' | 'TPathTypeKey' | 'DocType'> =
49-
TSchema extends Schema<infer EnforcedDocType, infer M, infer TInstanceMethods, infer TQueryHelpers, infer TVirtuals, infer TStaticMethods, infer TPathTypeKey, infer DocType>
48+
type ObtainSchemaGeneric<TSchema, alias extends 'EnforcedDocType' | 'TInstanceMethods' | 'TQueryHelpers' | 'TVirtuals' | 'TStaticMethods' | 'TPathTypeKey' | 'DocType'> =
49+
TSchema extends Schema<infer EnforcedDocType, any, infer TInstanceMethods, infer TQueryHelpers, infer TVirtuals, infer TStaticMethods, infer TPathTypeKey, infer DocType>
5050
? {
5151
EnforcedDocType: EnforcedDocType;
52-
M: M;
5352
TInstanceMethods: TInstanceMethods;
5453
TQueryHelpers: TQueryHelpers;
5554
TVirtuals: TVirtuals;

0 commit comments

Comments
 (0)