We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65a2823 commit 4a00a62Copy full SHA for 4a00a62
1 file changed
lib/mergeDeep.js
@@ -248,7 +248,9 @@ class MergeDeep {
248
modifications.push({})
249
additions.push({})
250
deletions.push({})
251
- if (this.isObjectNotArray(visited[id]) && this.isObjectNotArray(a)) {
+ // visited[id] may be a primitive string (from the non-object branch in processArrays)
252
+ // — only deep-compare when both sides are real objects
253
+ if (this.isObjectNotArray(visited[id])) {
254
// Strip the identity field before comparing — it was already used for matching
255
const idPropA = NAME_USERNAME_PROPERTY(a)
256
const idPropV = NAME_USERNAME_PROPERTY(visited[id])
0 commit comments