@graphql-tools/utils 11.2.1 → 11.2.2
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 +6 -1
- package/esm/mergeDeep.js +6 -1
- package/package.json +1 -1
package/cjs/mergeDeep.js
CHANGED
|
@@ -64,7 +64,12 @@ function mergeDeep(sources, respectPrototype = false, respectArrays = false, res
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
for (const key in source) {
|
|
67
|
-
|
|
67
|
+
// An own key present with value `undefined` is an explicit override and must win,
|
|
68
|
+
// distinct from the key being altogether absent from `source`. Assigning directly
|
|
69
|
+
// (rather than recursing through mergeDeep) avoids the top-level `source === undefined`
|
|
70
|
+
// skip above, which would otherwise silently discard this override and keep the prior
|
|
71
|
+
// value.
|
|
72
|
+
if (key in output && source[key] !== undefined) {
|
|
68
73
|
output[key] = mergeDeep([output[key], source[key]], respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols);
|
|
69
74
|
}
|
|
70
75
|
else {
|
package/esm/mergeDeep.js
CHANGED
|
@@ -61,7 +61,12 @@ export function mergeDeep(sources, respectPrototype = false, respectArrays = fal
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
for (const key in source) {
|
|
64
|
-
|
|
64
|
+
// An own key present with value `undefined` is an explicit override and must win,
|
|
65
|
+
// distinct from the key being altogether absent from `source`. Assigning directly
|
|
66
|
+
// (rather than recursing through mergeDeep) avoids the top-level `source === undefined`
|
|
67
|
+
// skip above, which would otherwise silently discard this override and keep the prior
|
|
68
|
+
// value.
|
|
69
|
+
if (key in output && source[key] !== undefined) {
|
|
65
70
|
output[key] = mergeDeep([output[key], source[key]], respectPrototype, respectArrays, respectArrayLength, respectNonEnumerableSymbols);
|
|
66
71
|
}
|
|
67
72
|
else {
|