@graphql-tools/utils 11.1.0 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/mergeDeep.js +3 -3
- package/esm/mergeDeep.js +3 -3
- package/package.json +1 -1
package/cjs/mergeDeep.js
CHANGED
|
@@ -48,6 +48,9 @@ function mergeDeep(sources, respectPrototype = false, respectArrays = false, res
|
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
50
|
if (isObject(source)) {
|
|
51
|
+
if (output == null) {
|
|
52
|
+
output = {};
|
|
53
|
+
}
|
|
51
54
|
if (firstObjectSource) {
|
|
52
55
|
const outputPrototype = Object.getPrototypeOf(output);
|
|
53
56
|
const sourcePrototype = Object.getPrototypeOf(source);
|
|
@@ -61,9 +64,6 @@ function mergeDeep(sources, respectPrototype = false, respectArrays = false, res
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
for (const key in source) {
|
|
64
|
-
if (output == null) {
|
|
65
|
-
output = {};
|
|
66
|
-
}
|
|
67
67
|
if (key in output) {
|
|
68
68
|
output[key] = mergeDeep([output[key], source[key]], respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols);
|
|
69
69
|
}
|
package/esm/mergeDeep.js
CHANGED
|
@@ -45,6 +45,9 @@ export function mergeDeep(sources, respectPrototype = false, respectArrays = fal
|
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
47
|
if (isObject(source)) {
|
|
48
|
+
if (output == null) {
|
|
49
|
+
output = {};
|
|
50
|
+
}
|
|
48
51
|
if (firstObjectSource) {
|
|
49
52
|
const outputPrototype = Object.getPrototypeOf(output);
|
|
50
53
|
const sourcePrototype = Object.getPrototypeOf(source);
|
|
@@ -58,9 +61,6 @@ export function mergeDeep(sources, respectPrototype = false, respectArrays = fal
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
for (const key in source) {
|
|
61
|
-
if (output == null) {
|
|
62
|
-
output = {};
|
|
63
|
-
}
|
|
64
64
|
if (key in output) {
|
|
65
65
|
output[key] = mergeDeep([output[key], source[key]], respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols);
|
|
66
66
|
}
|