merge-anything
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -45,3 +45,3 @@ 'use strict'; | ||
if (isWhat.isObject(newVal)) { | ||
carry[key] = mergeRecursively(targetVal, newVal); | ||
carry[key] = mergeRecursively(targetVal, newVal, extensions); | ||
return carry; | ||
@@ -48,0 +48,0 @@ } // all the rest |
@@ -41,3 +41,3 @@ import { isObject, isArray } from 'is-what'; | ||
if (isObject(newVal)) { | ||
carry[key] = mergeRecursively(targetVal, newVal); | ||
carry[key] = mergeRecursively(targetVal, newVal, extensions); | ||
return carry; | ||
@@ -44,0 +44,0 @@ } // all the rest |
{ | ||
"name": "merge-anything", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Merge two objects recursively. A simple & small integration.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -43,3 +43,3 @@ import { isObject, isArray } from 'is-what' | ||
if (isObject(newVal)) { | ||
carry[key] = mergeRecursively(targetVal, newVal) | ||
carry[key] = mergeRecursively(targetVal, newVal, extensions) | ||
return carry | ||
@@ -46,0 +46,0 @@ } |
@@ -72,9 +72,12 @@ import test from 'ava' | ||
origin = { | ||
someArray: ['a'] | ||
someArray: ['a'], | ||
a: {b: {c: ['x']}} | ||
} | ||
target = { | ||
someArray: ['b'] | ||
someArray: ['b'], | ||
a: {b: {c: ['y']}} | ||
} | ||
res = merge(extensions, origin, target) | ||
t.deepEqual(res, {someArray: ['a', 'b']}) | ||
t.deepEqual(res, {someArray: ['a', 'b'], a: {b: {c: ['x', 'y']}}}) | ||
// also works on base lvl | ||
res = merge(extensions, ['a'], ['b']) | ||
@@ -81,0 +84,0 @@ t.deepEqual(res, ['a', 'b']) |
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
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
22826
575