A very simple alternative of Object.assign()
that recursively copies objects' elements to a target object. Recursion is only applied to a pure object. The other types of elements are just replaced with source elements.
$ npm i simple-deep-assign
import deepAssign from 'simple-deep-assign';
const target = { a: 'a' };
deepAssign(target, { b: 'b' }, { c: [ 1, 2 ] }, { d: { a: 'a' } }, { d: { b: 'b' } });
target; // { a: 'a', b: 'b', c: [ 1, 2 ], d: { a: 'a', b: 'b' } }
https://ygoto3.github.io/simple-deep-assign/function/index.html#static-function-simpleDeepAssign