Object
mergeAll

It deeply merges objects and concatenates the arrays if any present.

Syntax

import { mergeAll } from '@opentf/std';
 
mergeAll(obj1, ...objN);

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

Examples

const a = { a: { b: [1] } };
const b = { a: { b: [2] } };
mergeAll(a, b); //=> { a: { b: [1, 2] }

Try