Skip to content

Commit

Permalink
Update deepcompare to fix #276
Browse files Browse the repository at this point in the history
  • Loading branch information
decyjphr authored Sep 6, 2022
1 parent a371d54 commit 0dac1a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mergeDeep.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class MergeDeep {

// Deep compare Array if the same element is there in source and target,
if (Array.isArray(source[key]) && Array.isArray(target[key])) {
// if (source[key].length !== target[key].length) {
// modifications[key] = source[key]
// }
if (source[key].length !== target[key].length) {
modifications[key] = source[key]
}
const visited = {}
const temp = [...source[key], ...target[key]]
for (const a of temp) {
Expand Down Expand Up @@ -247,4 +247,4 @@ class MergeDeep {
return modifications
}
}
module.exports = MergeDeep
module.exports = MergeDeep

0 comments on commit 0dac1a6

Please sign in to comment.