jsonjs.js
function deepMerge(one, another) {
  if (another == null || typeof another !== 'object') {
    return another;
  }

  if(one == null && typeof another === 'object') {
    if(Array.isArray(another)) {
      one = [];
    } else {
      one = {};
    }
  }

  var cloned = deepClone(another);

  for (var key in cloned) {
    if (cloned.hasOwnProperty(key)) {
      one[key] = deepMerge(one[key], another[key]);
    }
  }
  return one;
}
function deepMerge(one, another) {
  if (another == null || typeof another !== 'object') {
    return another;
  }

  if(one == null && typeof another === 'object') {
    if(Array.isArray(another)) {
      one = [];
    } else {
      one = {};
    }
  }

  var cloned = deepClone(another);

  for (var key in cloned) {
    if (cloned.hasOwnProperty(key)) {
      one[key] = deepMerge(one[key], another[key]);
    }
  }
  return one;
}
function deepMerge ( one , another ) { if ( another == null || typeof another !== 'object' ) { return another ; } if ( one == null && typeof another === 'object' ) { if ( Array . isArray ( another ) ) { one = [ ] ; } else { one = { } ; } } var cloned = deepClone ( another ) ; for ( var key in cloned ) { if ( cloned . hasOwnProperty ( key ) ) { one [ key ] = deepMerge ( one [ key ] , another [ key ] ) ; } } return one ; }
Deep merge one object to another
@param one
@param another
@returns {*}
Deep merge one object to another