From 28c79d7049f4d2b8e03106ea44cfc1f55fb88bd0 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Tue, 14 Dec 2021 17:06:07 -0500 Subject: [PATCH] perf(index.d.ts): simplify `ApplyBasicQueryCasting` to reduce memory usage re: #10349 --- index.d.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index 7199e955f3..ba0cafac46 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2590,14 +2590,7 @@ declare module 'mongoose' { [key: string]: any; }; - type ReadonlyPartial = { - [key in keyof TSchema]?: TSchema[key]; - }; - - type ApplyBasicQueryCasting = T extends mongodb.ObjectId ? T | string | (T | string)[] : // Allow strings for ObjectIds - T extends string ? T | RegExp | T[] : // Allow RegExps for strings - T extends (infer U)[] ? T | U : // Allow single array elements for arrays - T | T[]; + type ApplyBasicQueryCasting = T | T[] | any; type Condition = ApplyBasicQueryCasting | QuerySelector>; type _FilterQuery = {