Skip to content

Commit

Permalink
Fix #84, ensure that objects are cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Oct 1, 2016
1 parent 477f9b3 commit 2a7f3a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mergeCustomizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module.exports = function mergeCustomizer(a, b) {
return a.concat(b);
} else {
return a.map(function(item) {
return mergeWith({ x: item }, { x: b }, mergeCustomizer).x;
return mergeWith({}, { x: item }, { x: b }, mergeCustomizer).x;
});
}
} else if (isArray(b)) {
return b.map(function(item) {
return mergeWith({ x: a }, { x: item }, mergeCustomizer).x;
return mergeWith({}, { x: a }, { x: item }, mergeCustomizer).x;
});
}
};

0 comments on commit 2a7f3a8

Please sign in to comment.