Recursive function that takes two objects and updates the properties on the
first object based on the ones in the second. Basically, it's a recursive
version of Object.assign.
170937
function deepAssign(object, source) {
    for (var key in source) {
        if (source.hasOwnProperty(key)) {
            if (typeof object[key] === "object" && typeof source[key] === "object") {
                deepAssign(object[key], source[key]);
            } else {
                object[key] = source[key];
            }
        }
    }

    return object;
}
1097362
def recursive_update(_dict, _update):
    
    for k, v in _update.items():
        if isinstance(v, collections.Mapping):
            r = recursive_update(_dict.get(k, {}), v)
            _dict[k] = r
        else:
            _dict[k] = _update[k]
    return _dict
183035
@Override
	public Object put(String key, Object value) {
		if (key == null)
			return null;
		else if (key.indexOf('.') > 0)
			RecursiveObjectWriter.setProperty(this, key, value);
		else
			super.put(key, value);
		return value;
	}
1103662
function _merge(o1, o2) {
    Object.keys(o2).forEach(function (k) {
        if (o1[k] === undefined) {
            o1[k] = o2[k];
        } else {
            if ((typeof (o1[k])) === 'object') {
                _merge(o1[k], o2[k]);
            } else { // Last property wins!
                o1[k] = o2[k];
            }
        }
    });
}
1090892
function (object) {
		var result = { };
	
		for (var i in object) {
			if (!object.hasOwnProperty(i)) continue;
			
			if (isObject(object[i])) {
				var flatObject = this.flatten(object[i]);
				for (var x in flatObject) {
					if (!flatObject.hasOwnProperty(x)) continue;
					
					result[i + '.' + x] = flatObject[x];
				}
			} else {
				result[i] = object[i];
			}
		}

		return result;
	}
627754
function objMerge(a, b) {
	var obj = {};

	Object.keys(a).forEach(function (key) {
		obj[key] = a[key];
	});

	Object.keys(b).forEach(function (key) {
		obj[key] = b[key];
	});

	return obj;
}
850728
function( obj1, obj2 ) {
            var newObj = {};
            if ( obj1 ) {
                this.inheritAttrs( newObj, this.cloneObj( obj1 ) );
            }
            if ( obj2 ) {
                this.inheritAttrs( newObj, obj2 );
            }
            return newObj;
        }
91609
function collectAssignmentsInto(
  assignments: Array<{path: Array<string | number>, value: mixed}>,
  parentPath: Array<string | number>,
  parentValue: Object,
): void {
  // Iterate over the entries in the array or object.
  forEach(parentValue, (value, key) => {
    // The "path" is the sequence of keys to arrive at this assignment.
    const path = parentPath.concat(key);
    // For each entry, either add an assignment or recurse.
    if (typeof value === 'object' && value !== null) {
      collectAssignmentsInto(assignments, path, value);
    } else {
      assignments.push({path, value});
    }
  });
}
577327
function assignMergeValue(object, key, value) {
      if ((value !== undefined$1 && !eq(object[key], value)) ||
          (value === undefined$1 && !(key in object))) {
        baseAssignValue(object, key, value);
      }
    }
844871
function (target, objects, options) {

            for (var object in objects) {
                if (objects.hasOwnProperty(object)) {
                    recursiveMerge(target, objects[object]);
                }
            }

            function recursiveMerge(target, object) {
                for (var property in object) {
                    if (object.hasOwnProperty(property)) {
                        var current = object[property];
                        if (utils.getConstructor(current) === 'Object') {
                            if (!target[property]) {
                                target[property] = {};
                            }
                            recursiveMerge(target[property], current);
                        }
                        else {
                            // clearEmpty
                            if (options.clearEmpty) {
                                if (current == null) {
                                    continue;
                                }
                            }
                            target[property] = current;
                        }
                    }
                }
            }

            return target;
        }
696788
function equals(a, b) {
    function checkArray(n, m) {
        var i, len;

        for(i = 0, len = n.length; i < len; i++) {
            if(!equals(n[i], m[i])) {
                return false;
            }
        }

        return true;
    }

    function checkObject(n, m) {
        var i;

        for(i in n) {
            if(n.hasOwnProperty(i)) {
                if(!m.hasOwnProperty(i)) {
                    return false;
                }
                if(!equals(n[i], m[i])) {
                    return false;
                }
            }
        }

        return true;
    }

    if(!is.defined(a) && !is.defined(b)) {
        return true;
    }
    if(!is.defined(a) || !is.defined(b)) {
        return false;
    }
    if(is.array(a) && is.array(b)) {
        return checkArray(a, b) && checkArray(b, a);
    }
    if(!is.array(a) && is.object(a) && !is.array(b) && is.object(b)) {
        return checkObject(a, b) && checkObject(b, a);
    }
    if(!is.array(a) && !is.object(a) && !is.string(a) && isNaN(a)) {
        return true;
    }

    return a === b;
}
744777
function update (model, choice, value) {
  var copy = {};
  for (var v in model) copy[v] = model[v];
  copy[choice] = value;
  return copy;
}
110282
function diffObjects(value, oldValue) {
    if ( !(value && oldValue && typeof value === 'object' && typeof oldValue === 'object')) {
      throw new TypeError('Both values for diff.object must be objects');
    }
    var changeRecords = [];
    var prop, propOldValue, propValue;

    // Goes through the old object (should be a clone) and look for things that are now gone or changed
    for (prop in oldValue) {
      propOldValue = oldValue[prop];
      propValue = value[prop];

      // Allow for the case of obj.prop = undefined (which is a new property, even if it is undefined)
      if (propValue !== undefined && !diffBasic(propValue, propOldValue)) {
        continue;
      }

      // If the property is gone it was removed
      if (! (prop in value)) {
        changeRecords.push(new ChangeRecord(value, 'delete', prop, propOldValue));
      } else if (diffBasic(propValue, propOldValue)) {
        changeRecords.push(new ChangeRecord(value, 'update', prop, propOldValue));
      }
    }

    // Goes through the old object and looks for things that are new
    for (prop in value) {
      propValue = value[prop];
      if (! (prop in oldValue)) {
        changeRecords.push(new ChangeRecord(value, 'add', prop));
      }
    }

    if (Array.isArray(value) && value.length !== oldValue.length) {
      changeRecords.push(new ChangeRecord(value, 'update', 'length', oldValue.length));
    }

    return changeRecords;
  }
433137
function(items, obj1, obj2, obj3) {
		items = _.reduce(_.filter(_.pairs(items), 
			function(pair) { 
				return typeof pair[1] !== 'undefined';
			}),
			function(target, pair) { 
				target[pair[0]] = pair[1];
				return target;
			}, {}) || {};

		return _.extend.apply(null, [items].concat(_.rest(arguments)));
	}
82800
function clone(obj1, obj2, index) {
  index = index || 0;
  for (var i in obj2) {
    if ('object' == typeof i) obj1[i] = recursiveMerge(obj1[i], obj2[i], index++);
    else obj1[i] = obj2[i];
  }
  return obj1;
}
1048065
function object(obj, fn) {
  for (var key in obj) {
    if (has.call(obj, key)) {
      fn(key, obj[key]);
    }
  }
}
801283
function merge(Obj1, Obj2) {
    if (typeof Obj1 != 'object') {
        return {};
    }
    if (typeof Obj2 != 'object') {
        return Obj1;
    }
    for (var index in Obj2) {
        if (Obj2.hasOwnProperty(index)) {
            Obj1[index] = Obj2[index];
        }
    }

    return Obj1;
}