Merges the properties of the source object onto the
target object. Alters the target object.

@private
@param   {object}    destination
@param   {object}    source
@param   {boolean}   [deep=false]
@param   {boolean}   [handleErrors=false]
@return  {void}
6921
function(destination, source, deep, handleErrors) {
            var sourceKeys  = [],
                key         = '',
                i           = -1;

            deep = deep || false;
            handleErrors = handleErrors || false;

            try {
                if (Array.isArray(source)) {
                    for (i = 0; i < source.length; i++) {
                        sourceKeys.push(i);
                    }
                } else if (source) {
                    sourceKeys = Object.keys(source);
                }

                for (i = 0; i < sourceKeys.length; i++) {
                    key = sourceKeys[i];

                    if (!deep || typeof source[key] !== 'object' || this.isElement(source[key])) {
                        // All non-object properties, or all properties if shallow extend

                        destination[key] = source[key];
                    } else if (Array.isArray(source[key])) {
                        // Arrays

                        if (!destination[key]) {
                            destination[key] = [];
                        }

                        this.extend(destination[key], source[key], deep, handleErrors);
                    } else {
                        // Objects

                        if (!destination[key]) {
                            destination[key] = {};
                        }

                        this.extend(destination[key], source[key], deep, handleErrors);
                    }
                }
            } catch(err) {
                if (handleErrors) {
                    this.handleExtendError(err, destination);
                } else {
                    throw err;
                }
            }

            return destination;
        }
953964
function extend(destination, source, deepCopy) {
    if (Type.isUndefined(source)) {
        return extend({}, destination, false);
    }
    if (Type.isObject(destination) && Type.isObject(source) && !Type.isArray(source) && !Type.isArray(destination)) {
        Object.keys(source).forEach(function (key) {
            destination[key] = Type.assert(Type.BOOLEAN, deepCopy) && !!deepCopy ? copy(source[key]) : source[key];
        });
    } else {
        throw new Error('Core.extend:  invalid source or destination type:');
    }
    return destination;
}
828494
function copyProperties (source, destination) {
  var props = Object.getOwnPropertyNames(source);
  props.forEach(function (prop) {
    var desc;
    if (!destination[prop]) {
      desc = Object.getOwnPropertyDescriptor(source, prop);
      destination[prop] = {value: source[prop], writable: desc.writable};
    }
  });
}
166613
function(target,source) {
    var keys = Object.keys(source);
    var len = keys.length;
    for (var i = 0; i < len; i++) {
      var key = keys[i];
      if (lib.type.isObject(source[key])) {
        if (!lib.type.isObject(target[key])) {
          target[key] = {};
        }
        factory.merge(target[key],source[key]);
      } else {
        target[key] = source[key];
      }
    }
    return target;
  }
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;
		}
67558
function merge(object, options, ...sources) {

	/* iterate through all provided sources */
	for(const source of sources) {

		/* retrieve the property names defined on object */
		const propNames = Object.getOwnPropertyNames(source);

		/* recursively merge properties */
		for(const name of propNames) {
			const value = source[name];

			/* skip undefined values */
			if(options && options.skipUndefined && value === undefined) {
				continue;
			}

			/* skip if both values equals */
			if(value === object[name]) {
				continue;
			}

			/* merge based on options */
			if(value && typeof value === "object") {
				if(options && options.arrayConcat && Array.isArray(object[name]) && Array.isArray(value)) {
					object[name] = object[name].concat(value);
					if(options && options.arrayUnique) {
						object[name] = Array.from(new Set(object[name]));
					}
				} else if(Array.isArray(value)) {
					object[name] = options && options.overwrite || object[name] === undefined ? value : object[name];
				} else {
					object[name] = merge(object[name] || {}, options, value);
				}
			} else {
				object[name] = options && options.overwrite || object[name] === undefined ? value : object[name];
			}

		}

	}

	/* return merged object */
	return object;
}
746215
function merge() {
  var destination = {};
  var sources = [].slice.call(arguments, 0);
  sources.forEach(function(source) {
    var prop;
    for (prop in source) {
      if (prop in destination && Array.isArray(destination[prop])) {
        // Overwrite Arrays
        destination[prop] = source[prop];
      } else if (prop in destination && typeof destination[prop] === "object") {
        // Merge Objects
        destination[prop] = merge(destination[prop], source[prop]);
      } else {
        // Set new values
        destination[prop] = source[prop];
      }
    }
  });
  return destination;
}
320754
function(destination, source, name_list) {
		for (var i = 0, count = name_list.length; i < count; i++) {
			var name = name_list[i];
			if (name in source) destination[name] = source[name];
		}
	}
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;
}
684020
function deepMerge (base, custom) {
  Object.keys(custom).forEach(function (key) {
    if (!base.hasOwnProperty(key) || typeof base[key] !== 'object') {
      base[key] = custom[key]
    } else {
      base[key] = deepMerge(base[key], custom[key])
    }
  })

  return base
}
825285
function extend(destination, source) {
  for (var prop in source)
    if (source.hasOwnProperty(prop))
      destination[prop] = source[prop];
}
825451
def ko_deeper_merge!(source, options = {})
      default_opts = {:knockout_prefix => "--", :preserve_unmergeables => false}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end
658092
function mergeObject(target, source, create) {
  if (!source || !target) return;
  for (let pn in source) {
    if (_.has(target, pn) || create)
      target[pn] = source[pn];
  }
}
297411
def deep_merge(new_h)
      merge(new_h) do |_, ov, nv|
        if ov.respond_to?(:deep_merge) && nv.respond_to?(:deep_merge)
          then ov.deep_merge(
            nv
          )

        else
          nv
        end
      end
    end
818256
private void merge(Map<String, NodeT> source, Map<String, NodeT> target) {
        for (Map.Entry<String, NodeT> entry : source.entrySet()) {
            String key = entry.getKey();
            if (!target.containsKey(key)) {
                target.put(key, entry.getValue());
            }
        }
    }
97589
function merge (target, source) {
  source = source || {};
  return Object.keys(source).reduce((targetKey, key) => {
    targetKey[key] = source[key];
    return target;
  }, target);
}
1271769
function merge(destination, source, preserve) {
        preserve = preserve || [];

        for (var property in source) {
          if (preserve.indexOf(property) === -1) {
            destination[property] = source[property];
          }
        }

        return destination;
      }