Like Object.assign, but works in a deep manner.

@param	{object}	target - Target object to be merged into
@param	{object}	sources - Source objects to be merged onto target

@return	{object} The target object
174219
function deepMerge(target, ...sources) {
	let src
	while (true) {
		if (!sources.length)
			return target
		src = sources.shift()
		if (src)
			break
	}

	for (let k in src) {

		let v = src[k]
		let existing = target[k]

		if (typeof v === 'object') {
			if (v === null) {
				target[k] = null
			} else if (Array.isArray(v)) {
				target[k] = v.slice()
			} else {
				if (typeof existing !== 'object')
					target[k] = deepMerge({}, v)
				else
					deepMerge(existing, v)
			}
		} else {
			//v is not object/array
			target[k] = v
		}
	}

	return deepMerge(target, ...sources)
}
272774
function merge(target, source) {
    if (source === null) {
        return target
    }
    var props = Object.getOwnPropertyNames(target)
    props.forEach(function (name) {
        var s = gettype(source[name])
        if (s !== 'undefined') {
            var t = gettype(target[name])
            if (t !== s) {
                throw new Error(`Type mismatch between '${t}' and '${s}' for '${name}'`)
            }
            if (t === 'object') {
                merge(target[name], source[name])
            } else {
                target[name] = source[name]
            }
        }
    })
    return target
}
1031245
function extend(target) {
    for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i]
            , keys   = Object.keys(source);

        for (var j = 0; j < keys.length; j++) {
            var name = keys[j];
            target[name] = source[name];
        }
    }

    return target;
}
15064
function copy(target, obj) {
  if (isObject(obj)) {
    forIn(obj, function(value, key) {
      target[key] = value;
    });
  }
}
206586
function mix (target, object) {
    for (var key in object) {
        target[key] = object[key];
    }
    return target;
}
573504
function _assignGenerator(own) {
    let _copy = function(target, ...source) {
        let deep = true;
        if (is.Boolean(target)) {
            deep = target;
            target = 0 in source
                ? source.shift()
                : null;
        }

        if (is.Array(target)) {
            source.forEach(sc => {
                target.push(...sc);
            });
        } else if (is.Object(target)) {
            source.forEach(sc => {
                for (let key in sc) {
                    if (own && !sc.hasOwnProperty(key))
                        continue;
                    let so = sc[key],
                        to = target[key];
                    if (is.PureObject(so)) {
                        target[key] = deep
                            ? extend(true, is.PureObject(to)
                                ? to
                                : {}, so)
                            : so;
                    } else if (is.Array(so)) {
                        target[key] = deep
                            ? extend(true, is.Array(to)
                                ? to
                                : [], so)
                            : so;
                    } else {
                        target[key] = so;
                    }
                }
            });
        }
        // Do nothing
        return target;
    };
    return _copy;
}
1241975
function (target, source) {
        var key;

        for (key in source) {
            if (source.hasOwnProperty(key) && !_.isUndefined(source[key])) {
                target[key] = source[key];
            }
        }

        return target;
    }
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;
}
744048
def __extend_targets_sources(target, source):
    
    if not SCons.Util.is_List(target):
        target = [target]
    if not source:
        source = target[:]
    elif not SCons.Util.is_List(source):
        source = [source]
    if len(target) < len(source):
        target.extend(source[len(target):])
        
    return target, source
1134153
function _assign (target, source) {
  var s, from, key;
  var to = Object(target);
  for (s = 1; s < arguments.length; s++) {
    from = Object(arguments[s]);
    for (key in from) {
      if (own(from, key)) {
        to[key] = from[key];
      }
    }
  }
  return to
}
776513
def Assign(target, source):
    """"""
    if not isinstance(target, list):
        target = [target]
    if not isinstance(source, list):
        source.prefix = u" "
        source = [source]

    return Node(syms.atom,
                target + [Leaf(token.EQUAL, u"=", prefix=u" ")] + source)
933008
function(obj, target) {
            if (obj == null) {
                return null;
            }
            var r = JSON.parse(JSON.stringify(obj));
            if (!target) {
                return r;
            }

            for (var i in r) {
                target[i] = r[i];
            }
            return target;
        }
1159711
function (target, source) {
				getOwnPropertyNames(source).forEach(function (key) {
					defineProperty(
						target,
						key,
						getOwnPropertyDescriptor(source, key)
					);
				});
				return target;
			}
673319
function merge(target, source) {
                target.additionalNodes = target.additionalNodes || [];
                target.additionalNodes.push(source.node);
                if (source.additionalNodes) {
                    (_a = target.additionalNodes).push.apply(_a, source.additionalNodes);
                }
                target.children = ts.concatenate(target.children, source.children);
                if (target.children) {
                    mergeChildren(target.children);
                    sortChildren(target.children);
                }
                var _a;
            }
982685
function mergeArrays(source, target) {
  for (let i = 0; i < source.length; i++) {
    // If the item is not yet in the target array, add it
    if (target.indexOf(source[i]) === -1) {
      target.push(source[i])
    }
  }

  return target
}
833122
function extend(targetObj, sourceObject) {
        for (var key in sourceObject) {
            if (sourceObject.hasOwnProperty(key)) {
                targetObj[key] = sourceObject[key];
            }
        }
    }
366763
function (target) {
  if (target) {
    var args = arguments
    if (target === true) {
      if (args.length > 1) {
        target = isArray(target[1]) ? [] : {}
        return extend(target, args, true)
      }
    } else {
      return objectAssignFns ? objectAssignFns.apply(Object, args) : extend(target, args)
    }
  }
  return target
}