From 1233c35c0011c1ff922c3ab5acdaca2ca1a45673 Mon Sep 17 00:00:00 2001 From: bnns Date: Thu, 6 Feb 2025 16:22:28 +0200 Subject: [PATCH 1/3] chore: bump version to 2.0.3 and add cloneProtoObject option to Options interface --- package.json | 2 +- types/index.d.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 93c81f6..2a71ad5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fastify/deepmerge", - "version": "2.0.2", + "version": "2.0.3", "description": "Merges the enumerable properties of two or more objects deeply.", "main": "index.js", "type": "commonjs", diff --git a/types/index.d.ts b/types/index.d.ts index fc7cb85..d2598aa 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -61,9 +61,18 @@ type MergeArrayFnOptions = { getKeys: (value: object) => string[]; } + +/** + * A function responsible handling the cloning logic of the provided prototype object. + * + * @param value - The proto object to clone. + * @returns the resulting clone (can also return the object itself if you do not want clone but replace). + */ +type CloneProtoObjectFn = (value: any) => any type MergeArrayFn = (options: MergeArrayFnOptions) => (target: any[], source: any[]) => any[] interface Options { + cloneProtoObject?: CloneProtoObjectFn; mergeArray?: MergeArrayFn; symbols?: boolean; all?: boolean; From b417e4798b36497c4630a1255561a114aa982e96 Mon Sep 17 00:00:00 2001 From: bnns Date: Thu, 6 Feb 2025 16:23:38 +0200 Subject: [PATCH 2/3] Removed Extra Space --- types/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index d2598aa..dd94748 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -61,7 +61,6 @@ type MergeArrayFnOptions = { getKeys: (value: object) => string[]; } - /** * A function responsible handling the cloning logic of the provided prototype object. * From 3585dc0fee878cbdae26bcea8d5d027e669fd695 Mon Sep 17 00:00:00 2001 From: bnns Date: Thu, 6 Feb 2025 16:47:34 +0200 Subject: [PATCH 3/3] Only typings documentation change shouldn't have a version bump. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a71ad5..93c81f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fastify/deepmerge", - "version": "2.0.3", + "version": "2.0.2", "description": "Merges the enumerable properties of two or more objects deeply.", "main": "index.js", "type": "commonjs",