-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
Using Object.assign with an empty target, only the target is changed, not the inputs/arguments. Usign assign-deep, the inputs also get overwritten. Is this expected behaviour? I did not expect this.
var assignDeep = require("assign-deep")
var o1 = { a: 1, b: 1, c: {a: 1} };
var o2 = { b: 2, c: {a:2} };
var o3 = { c: {a:3} };
console.log(assignDeep({}, o1, o2, o3));
// Expected output: Object {a: 1, b: 2, c: Object {a: 3}}
console.log('o1', o1);
// Expected output: Object {a: 1, b: 1, c: Object {a: 1}}
// Actual output: Object {a: 1, b: 1, c: Object {a: 3}}
lisandro101 and DimaGashko