import { merge } from "https://deno.land/x/fathym_common@v0.2.148-fluent-builder/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 replaced with the new array.
Examples
From direct import
From direct import
import { merge } from '@fathym/common/merge';
const merged = merge({ 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: [4, 5, 6] }
From common import
From common import
import { merge } from '@fathym/common';
const merged = merge({ 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: [4, 5, 6] }