import { mergeWithArrays } from "https://deno.land/x/fathym_common@v0.2.147-integration/src/common/merge/merge.ts";
Merges objects recursively, in a deep merge pattern. Any arrays, maps or sets that exist in both objects will be merged the new array.
Examples
From direct import
From direct import
import { mergeWithArrays } from '@fathym/common/merge';
const merged = mergeWithArrays({ a: 1 }, { b: 2, c: 3 }, { c: 4, d: [1, 2, 3]}, { d: [4, 5, 6] });
console.log(merged); // { a: 1, b: 2, c: 4, d: [1, 2, 3, 4, 5, 6] }
From common import
From common import
import { mergeWithArrays } from '@fathym/common';
const merged = mergeWithArrays({ a: 1 }, { b: 2, c: 3 }, { c: 4, d: [1, 2, 3]}, { d: [4, 5, 6] });
console.log(merged); // { a: 1, b: 2, c: 4, d: [1, 2, 3, 4, 5, 6] }