@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 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
- if (key in output) {
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
- if (key in output) {
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/utils",
3
- "version": "11.2.1",
3
+ "version": "11.2.2",
4
4
  "description": "Common package containing utils and types for GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {