It deeply merges objects or arrays.
Syntax
import { merge } from '@opentf/std';
merge(obj1, ...objN);
✅
Immutable: This does not mutate the given arrays or objects.
Examples
const a = { a: { b: 1 }, d: 3 };
const b = { a: { c: 2 }, e: 5 };
merge(a, b); //=> { a: { b: 1, c: 2 }, d: 3, e: 5 }
const a = { a: [1, 2] };
const b = { a: [3, 4, 5] };
const c = { a: [7, 8] };
merge(a, b, c); //=> { a: [7, 8, 5] }