diff --git a/lib/mergeDeep.js b/lib/mergeDeep.js index a799877e..d6c82774 100644 --- a/lib/mergeDeep.js +++ b/lib/mergeDeep.js @@ -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) { @@ -247,4 +247,4 @@ class MergeDeep { return modifications } } -module.exports = MergeDeep \ No newline at end of file +module.exports = MergeDeep