From 36384e7fc360b62c9d9d3cb3b65c6b01fe2682f8 Mon Sep 17 00:00:00 2001 From: Jan Prieser Date: Wed, 6 Dec 2023 21:54:40 +0100 Subject: [PATCH 1/3] add missing Type for applyDefaults --- types/models.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/models.d.ts b/types/models.d.ts index 5a438b61d57..2690c4ec3ab 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -183,6 +183,9 @@ declare module 'mongoose' { /* Cast the given POJO to the model's schema */ castObject(obj: AnyObject, options?: { ignoreCastErrors?: boolean }): TRawDocType; + /* Apply defaults to the given document or POJO. */ + applyDefaults(obj: AnyObject|TRawDocType): TRawDocType; + /** * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one From 0fc2e5c1cb9a0b5ecca0419e409aaa7f8367f3ee Mon Sep 17 00:00:00 2001 From: Jan Prieser Date: Wed, 6 Dec 2023 22:40:26 +0100 Subject: [PATCH 2/3] remove whitespace --- types/models.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/models.d.ts b/types/models.d.ts index 2690c4ec3ab..15c2276c8bf 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -185,7 +185,7 @@ declare module 'mongoose' { /* Apply defaults to the given document or POJO. */ applyDefaults(obj: AnyObject|TRawDocType): TRawDocType; - + /** * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one From 78a78e63098a75458a1a4c2fa25c88e9d032f24c Mon Sep 17 00:00:00 2001 From: Jan Prieser Date: Wed, 6 Dec 2023 22:42:43 +0100 Subject: [PATCH 3/3] seperate overrides --- types/models.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/models.d.ts b/types/models.d.ts index 15c2276c8bf..3f79fd5b4d3 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -184,7 +184,8 @@ declare module 'mongoose' { castObject(obj: AnyObject, options?: { ignoreCastErrors?: boolean }): TRawDocType; /* Apply defaults to the given document or POJO. */ - applyDefaults(obj: AnyObject|TRawDocType): TRawDocType; + applyDefaults(obj: AnyObject): AnyObject; + applyDefaults(obj: TRawDocType): TRawDocType; /** * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`,