(recursive)? merging of (cloned)? objects.
npm install merge
merge(clone: boolean, ...items: Object[])
merge(...items: Object[])
merge.recursive(clone: boolean, ...items: Object[])
merge.recursive(...items: Object[])
const objectA = {};
merge(objectA, { value: 1 }, { str: "hello world" });
const objectB = merge(true, objectA, { value: 2 });
objectA; // { value: 1, str: 'hello world' }
objectB; // { value: 2, str: 'hello world' }
const objectA = {};
merge.recursive(
objectA,
{ level: { value: 1 } },
{ level: { str: "hello world" } },
);
const objectB = merge.recursive(true, objectA, { level: { value: 2 } });
objectA.level; // { value: 1, str: 'hello world' }
objectB.level; // { value: 2, str: 'hello world' }
pnpm build
pnpm test
Distributed under the MIT License. See LICENSE file in each package for more information.