Skip to content

Commit

Permalink
perf(index.d.ts): simplify ApplyBasicQueryCasting to reduce memory …
Browse files Browse the repository at this point in the history
…usage re: #10349
  • Loading branch information
vkarpov15 committed Dec 14, 2021
1 parent 4af1f56 commit 28c79d7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2590,14 +2590,7 @@ declare module 'mongoose' {
[key: string]: any;
};

type ReadonlyPartial<TSchema> = {
[key in keyof TSchema]?: TSchema[key];
};

type ApplyBasicQueryCasting<T> = 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 | T[] | any;
type Condition<T> = ApplyBasicQueryCasting<T> | QuerySelector<ApplyBasicQueryCasting<T>>;

type _FilterQuery<T> = {
Expand Down

0 comments on commit 28c79d7

Please sign in to comment.