@fastify/deepmerge
Advanced tools
Comparing version 1.3.0 to 2.0.0
{ | ||
"name": "@fastify/deepmerge", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "Merges the enumerable properties of two or more objects deeply.", | ||
"main": "index.js", | ||
"type": "commonjs", | ||
"types": "types/index.d.ts", | ||
@@ -25,6 +26,6 @@ "scripts": { | ||
"devDependencies": { | ||
"standard": "^17.0.0", | ||
"tap": "^16.3.0", | ||
"tape": "^5.6.1", | ||
"tsd": "^0.24.1" | ||
"standard": "^17.1.0", | ||
"tap": "^18.7.1", | ||
"tape": "^5.7.5", | ||
"tsd": "^0.30.7" | ||
}, | ||
@@ -31,0 +32,0 @@ "files": [ |
@@ -64,3 +64,3 @@ # @fastify/deepmerge | ||
The `mergeAray`-Function needs to return the actual Array merging function, which accepts two parameters of type | ||
The `mergeArray`-Function needs to return the actual Array merging function, which accepts two parameters of type | ||
Array, and returns a value. | ||
@@ -161,2 +161,2 @@ | ||
Licensed under [MIT](./LICENSE). | ||
Licensed under [MIT](./LICENSE). |
@@ -15,7 +15,7 @@ type DeepMergeFn = <T1, T2>(target: T1, source: T2) => DeepMerge<T1, T2>; | ||
type MergeTypes<T, U> = T extends Array<infer A1> | ||
? U extends Array<infer A2> | ||
? Array<A1 | A2> | ||
: T | ||
: U | ||
type MergeArrays<T, U> = T extends readonly any[] | ||
? U extends readonly any[] | ||
? [...T, ...U] | ||
: never | ||
: never | ||
@@ -42,4 +42,4 @@ type DifferenceKeys< | ||
? U | ||
: [T, U] extends [any[], any[]] | ||
? MergeTypes<T, U> | ||
: [T, U] extends [readonly any[], readonly any[]] | ||
? MergeArrays<T, U> | ||
: [T, U] extends [{ [key: string]: unknown }, { [key: string]: unknown }] | ||
@@ -46,0 +46,0 @@ ? DeepMergeHelper<T, U> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14312
161
1