Shallow Merges objects or arrays.

Syntax

TypeScript
import { shallowMerge } from '@opentf/std';

shallowMerge(obj1, ...objN);
Info

Immutable: This does not mutate the given arrays or objects.

Examples

TypeScript
const a = { a: 1 };
const b = { b: 2 };
shallowMerge(a, b); //=> { a: 1, b: 2 }

const a = [1];
const b = [2];
const c = [3];
shallowMerge(a, b, c); //=> [3]
Last updated on
Edit this page