import { deepMerge } from "https://deno.land/std@0.202.0/collections/mod.ts";
Merges the two given Records, recursively merging any nested Records with the second collection overriding the first in case of conflict
For arrays, maps and sets, a merging strategy can be specified to either
replace
values, or merge
them instead. Use includeNonEnumerable
option
to include non-enumerable properties too.
Examples
Example 1
Example 1
import { deepMerge } from "https://deno.land/std@0.202.0/collections/deep_merge.ts";
import { assertEquals } from "https://deno.land/std@0.202.0/assert/assert_equals.ts";
const a = { foo: true };
const b = { foo: { bar: true } };
assertEquals(deepMerge(a, b), { foo: { bar: true } });
Type Parameters
Options extends DeepMergeOptions