This function merges two objects. Non-primitive properties are merged recursively. Other properties are overridden by assignment. Sourse objects are not changed.
Install:
npm i deep-merge-objects
Require:
let merge = require('deep-merge-objects');
merge({a:'a'}, {b: 'b'});