Shallow merges two structures by mutating the first parameter.

@param {object} one Object to be merged into.
@param {?object} two Optional object with properties to merge from.
181694
function mergeInto(one, two) {
  checkMergeObjectArg(one);
  if (two != null) {
    checkMergeObjectArg(two);
    for (var key in two) {
      if (!two.hasOwnProperty(key)) {
        continue;
      }
      one[key] = two[key];
    }
  }
}
472341
function merge(/* obj1 .. objN */){
    var result = {};

    for (var i = 0; i < arguments.length; i++)
      extend(result, arguments[i]);

    return result;
  }
836109
function mergeRecursive(obj1, obj2) {
	"use strict";

	/*jshint forin:false */
	for (var p in obj2) {
		try {
			// Property in destination object set; update its value.
			if (obj2[p].constructor === Object) {
				obj1[p] = mergeRecursive(obj1[p], obj2[p]);
			} else {
				obj1[p] = obj2[p];
			}
		} catch(e) {
			// Property in destination object not set; create it and set its value.
			obj1[p] = obj2[p];
		}
	}

	return obj1;
}
506713
def deep_merge(arg1, arg2, key=nil)
      # Attempt deep merge if the two arguments are
      # instances of the same class.
      if arg1.class == arg2.class
        # Preserve arg1's :code and :name.
        if (not key.nil?) and [:code, :name].include? key.to_sym
          return arg1
        # Recursively call deep merge for Hash objects.
        elsif arg1.respond_to? :to_hash
          r = {}
          return arg1.to_hash.merge(arg2.to_hash) do |key, oldval, newval|
            r[key] = deep_merge(oldval, newval, key)
          end
        # Concatenate Arrays and return uniq elements.
        elsif arg1.instance_of? Array
          return arg1.concat(arg2).uniq
        # If Institutions responds to the :key_add method,
        # go ahead and use that to add the Objects together.
        elsif respond_to? "#{key}_add".to_sym
          return send "#{key}_add".to_sym, arg1, arg2
        end
      end
      # NOTE: Commenting this out since I'm not sure this is desirable functionality.
      # If the two args aren't the same class, but arg1 is
      # Array, append arg2 to arg1.
      # if arg1.instance_of? Array
      #   return arg1.dup<<arg2
      # end
      # We tried.
      # If all else fails just replace arg1 with arg2.
      return arg2
    end
1146044
function merge_objects(obj1,obj2){
        var obj3 = {};
        for (var attrname1 in obj1) { obj3[attrname1] = obj1[attrname1]; }
        for (var attrname2 in obj2) { obj3[attrname2] = obj2[attrname2]; }
        return obj3;
    }
473602
function addToResult(currentObj, otherObj, key) {
      var immutableValue = Immutable(otherObj[key]);
      var mergerResult = merger && merger(currentObj[key], immutableValue, config);
      var currentValue = currentObj[key];

      if ((result !== undefined) ||
        (mergerResult !== undefined) ||
        (!currentObj.hasOwnProperty(key)) ||
        !isEqual(immutableValue, currentValue)) {

        var newValue;

        if (mergerResult !== undefined) {
          newValue = mergerResult;
        } else if (deep && isMergableObject(currentValue) && isMergableObject(immutableValue)) {
          newValue = Immutable.merge(currentValue, immutableValue, config);
        } else {
          newValue = immutableValue;
        }

        if (!isEqual(currentValue, newValue) || !currentObj.hasOwnProperty(key)) {
          if (result === undefined) {
            // Make a shallow clone of the current object.
            result = quickCopy(currentObj, instantiateEmptyObject(currentObj));
          }

          result[key] = newValue;
        }
      }
    }
334452
function merge_objects_(b) {
		if(is.func(b)) {
			b = b();
		}
		debug.assert(b).is('object');
		_merge_object(opts, a, b);
	}
811051
function mergeObject(target, source) {
  // create a variable to hold the target object
  // so it can be changed if its not an object
  let targetObject = target;
  let sourceObject = source;

  if (!isObj(target)) {
    targetObject = {};
  }

  if (!isObj(source)) {
    sourceObject = {};
  }

  // get the object keys for the target and source objects
  const targetKeys = Object.keys(targetObject);
  const sourceKeys = Object.keys(sourceObject);

  // create a empty object for the result
  const result = {};

  // go through all the target keys
  targetKeys.forEach((key) => {
    // check if the source object contains the key
    if (sourceKeys.indexOf(key) !== -1) {
      // check if the target value is null if it is
      // set the result as the source value, this
      // should be fine because if the source value
      // is null it isn't overriding the target value
      // and if it isn't null it is overriding
      // as expected
      if (targetObject[key] === null) {
        result[key] = sourceObject[key];
      } else if (isObj(targetObject[key])) {
        // check if the source value is an object if
        // it is then we need to merge both objects and
        // set the result value to the merged object
        if (isObj(sourceObject[key])) {
          result[key] = mergeObject(targetObject[key], sourceObject[key]);
        } else {
          // if the source value isn't an object we can
          // simply override the value
          result[key] = sourceObject[key];
        }
      } else {
        // if the target value isn't an object we can
        // simply override the value
        result[key] = sourceObject[key];
      }
    } else {
      // if the source doesn't contain the key set the result
      // as the original from the target
      result[key] = targetObject[key];
    }
  });

  // go through all the source keys
  sourceKeys.forEach((key) => {
    // if the target doesn't contain the key
    // then the value is new and should be added
    // to the result object
    if (targetKeys.indexOf(key) === -1) {
      result[key] = sourceObject[key];
    }
  });

  return result;
}
936635
def deep_merge(hash_one, hash_two)
      merged = hash_one.dup
      hash_two.each do |key, value|
        merged[key] = case
        when hash_one[key].is_a?(Hash) && value.is_a?(Hash)
          deep_merge(hash_one[key], value)
        when hash_one[key].is_a?(Array) && value.is_a?(Array)
          (hash_one[key] + value).uniq
        else
          value
        end
      end
      merged
    end
496993
function merge (obj1, obj2) {
  var c = {},
    keys = Object.keys(obj2),
    i;

  for (i = 0; i !== keys.length; i++) {
    c[keys[i]] = obj2[keys[i]];
  }

  keys = Object.keys(obj1);
  for (i = 0; i !== keys.length; i++) {
    if (!c.hasOwnProperty(keys[i])) {
      c[keys[i]] = obj1[keys[i]];
    }
  }

  return c;
}
400703
function mergeDefaults(obj, src) {
    var objValue = Immutable.fromJS(obj);
    var srcValue = Immutable.fromJS(src);

    return srcValue.mergeDeep(objValue).toJS();
}
791546
function merge() {
  let i = 1
    , key
    , val
    , obj
    , target
    ;

  // make sure we don't modify source element and it's properties
  // objects are passed by reference
  target = clone( arguments[0] );
  while (obj = arguments[i++]) {
    for (key in obj) {
      if ( !hasOwn(obj, key) ) {
          continue;
      }

      val = obj[key];
      if ( isObject(val) && isObject(target[key]) ){
        // inception, deep merge objects
        target[key] = merge(target[key], val);
      } else {
        let is_url = val && val.type == url;
        let is_path = val && val.type == path;

        // make sure arrays, regexp, date, objects are cloned
        target[key] = clone(val);
        if( is_url ){
          target[key].type = url;
        }

        if( is_path ){
          target[key].type = path;
        }
      }
    }
  }
  return target;
}
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)));
	}
1093080
function mergeOptions(defaults, settings) {
  var options = _extends({}, defaults, settings);

  // `Object.assign` do not deeply merge objects, so we
  // have to do it manually for every nested object
  // in options. Although it does not look smart,
  // it's smaller and faster than some fancy
  // merging deep-merge algorithm script.
  if (settings.hasOwnProperty('classes')) {
    options.classes = _extends({}, defaults.classes, settings.classes);

    if (settings.classes.hasOwnProperty('direction')) {
      options.classes.direction = _extends({}, defaults.classes.direction, settings.classes.direction);
    }
  }

  if (settings.hasOwnProperty('breakpoints')) {
    options.breakpoints = _extends({}, defaults.breakpoints, settings.breakpoints);
  }

  return options;
}
800128
function mergeIntoWithNoDuplicateKeys(one, two) {
  ("production" !== "development" ? invariant(
    one && two && typeof one === 'object' && typeof two === 'object',
    'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
  ) : invariant(one && two && typeof one === 'object' && typeof two === 'object'));

  for (var key in two) {
    if (two.hasOwnProperty(key)) {
      ("production" !== "development" ? invariant(
        one[key] === undefined,
        'mergeIntoWithNoDuplicateKeys(): ' +
        'Tried to merge two objects with the same key: `%s`. This conflict ' +
        'may be due to a mixin; in particular, this may be caused by two ' +
        'getInitialState() or getDefaultProps() methods returning objects ' +
        'with clashing keys.',
        key
      ) : invariant(one[key] === undefined));
      one[key] = two[key];
    }
  }
  return one;
}
760565
function mergeArray(a, b) {
  var adds = [];
  var ai = 0;

  for (var i = 0; i < b.length; i++) {
    if (('object' === type(a[i]) && 'object' === type(b[i]))
    ||  ('array' === type(a[i]) && 'array' === type(b[i]))) {
      a[i] = merge(a[i], b[i]);
    } else if ('object' === type(b[i])) {
      adds.push(merge({}, b[i]));
    } else if ('array' === type(b[i])) {
      adds.push(merge([], b[i]));
    } else if (!~a.indexOf(b[i])) {
      adds.push(b[i]);
    }
  }

  for (; ai < adds.length; ai++) {
    a.push(adds[ai]);
  }

  return a;
}
500633
function deepmerge(foo, bar) {
			var merged = {};
			for (var each in bar) {
				if (each in foo) {
					if (typeof(foo[each]) == "object" && typeof(bar[each]) == "object") {
						merged[each] = deepmerge(foo[each], bar[each]);
					} else {
						merged[each] = [foo[each], bar[each]];
					}
				} else {
					merged[each] = bar[each];
				}
			}
			for (var each in foo) {
				if (!(each in bar)) {
					merged[each] = foo[each];
				}
			}
			return merged;
		}