Merge with support for objects and arrays.
npm install merge-both
const mergeBoth = require("merge-both");
mergeBoth(
{
a: ["a", "b"],
b: { b: "c" },
c: "e"
},
{
a: ["c", "d"],
b: { b: "f", c: "d" }
}
);
// Returned object
{
a: ["a", "b", "c", "d"],
b: { b: "f", c: "d" },
c: "e",
}
Type: object
The main object to merge.
Type: object
The other objects to merge.