Extends the specified object with another object.

@method extend
@static
@param {Object} target Object to extend.
@param {Object} [obj]* Multiple objects to extend with.
@return {Object} Same as target, the extended object.
2525
function(target) {
		var undef;

		each(arguments, function(arg, i) {
			if (i > 0) {
				each(arg, function(value, key) {
					if (value !== undef) {
						if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) {
							extend(target[key], value);
						} else {
							target[key] = value;
						}
					}
				});
			}
		});
		return target;
	}
274057
function (sourceObject) {
		sourceObject = sourceObject || {};

		if (sourceObject.constructor !== Array && typeof sourceObject !== "object") {
			return sourceObject;
		}

		var newObject = (sourceObject.constructor === Array) ? [] : {};

		return _extend(true, newObject, sourceObject);
	}
593213
function extendObj (obj, key, source) {
  obj[key] = obj[key] || {};
  for(var args = arguments, i = 2; i < args.length; i++) {
    source = args[i];
    for (var k in source)
      if (own(source, k)) obj[key][k] = source[k];
  }
  return obj[key]
}
568616
function extend(target,       // @arg Object - global
                constructors, // @arg ConstructorObject - { "Object": { keys: Object_keys, ... }, ... }
                override) {   // @arg Boolean = false
//{@dev
    if (!global["BENCHMARK"]) {
        $valid($type(constructors, "Object"),       extend, "constructors");
        $valid($type(override,     "Boolean|omit"), extend, "override");
    }
//}@dev

    override = override || false;

    for (var klass in constructors) { // Object, Array, String, Function, ...
        if ( !(klass in target) ) {
            target[klass] = constructors[klass];
        }
        _extend(target[klass], constructors[klass]);
    }

    function _extend(extendTarget, object) {
        for (var key in object) { // "keys", "prototype", ...
            if (key === "prototype") {
                // --- extend Object.property ---
                if (!(key in extendTarget)) { // extendTarget has prototype?
                    extendTarget[key] = {};   // extendTarget["prototype"] = {}
                }
                for (var prop in object[key]) {
                    _defineProperty(extendTarget[key], prop, object[key][prop]);
                }
            } else {
                _defineProperty(extendTarget, key, object[key]);
            }
        }
    }

    function _defineProperty(obj, key, value) {
        if ( override || !(key in obj) ) {
            Object.defineProperty(obj, key, {
                "configurable": true, // false is immutable
                "enumerable": false,  // false is invisible(for in loop)
                "writable": true,     // false is read-only
                "value": value
            });
        }
    }
}
734717
function extend(obj) {
        for (var i = 1; i < arguments.length; i++) {
            for (var key in arguments[i]) {
                obj[key] = arguments[i][key];
            }
        }
        return obj;
    }
727614
function extend(target, source, modify) {
    var result = target ? modify ? target : extend({}, target, true) : {};
    if (!source) return result;
    for (var key in source) {
        if (source.hasOwnProperty(key) && source[key] !== undefined) {
            result[key] = source[key];
        }
    }
    return result;
}
157546
function() {
    var options, name, src, copy, copyIsArray, clone,
      target = arguments[0] || {},
      i = 1,
      length = arguments.length,
      deep = true;

    // Handle case when target is a string or something (possible in deep copy)
    if (typeof target !== "object" && typeof target !== 'function') {
      target = {};
    }

    for (; i < length; i++) {
      // Only deal with non-null/undefined values
      if ((options = arguments[i]) !== null) {
        // Extend the base object
        for (name in options) {
          src = target[name];
          copy = options[name];

          // Prevent never-ending loop
          if (target === copy) {
            continue;
          }

          // Recurse if we're merging plain objects or arrays
          if (deep && copy && (copy.constructor == Object || (copyIsArray = (copy.constructor == Array)))) {
            if (copyIsArray) {
              copyIsArray = false;
              // Overwrite the source with a copy of the array to merge in
              clone = [];
            } else {
              clone = src && src.constructor == Object ? src : {};
            }

            // Never move original objects, clone them
            target[name] = Util.merge(clone, copy);

          // Don't bring in undefined values
          } else if (copy !== undefined) {
            target[name] = copy;
          }
        }
      }
    }

    // Return the modified object
    return target;
  }
241763
function extend(target = {}, ...args) {
  let i = 0;
  const length = args.length;
  let options;
  let name;
  let src;
  let copy;
  if (!target) {
    target = exports.isArray(args[0]) ? [] : {};
  }
  for (; i < length; i++) {
    options = args[i];
    if (!options) {
      continue;
    }
    for (name in options) {
      src = target[name];
      copy = options[name];
      if (src && src === copy) {
        continue;
      }
      if (exports.isArray(copy)) {
        target[name] = extend([], copy);
      } else if (exports.isObject(copy)) {
        target[name] = extend(src && exports.isObject(src) ? src : {}, copy);
      } else {
        target[name] = copy;
      }
    }
  }
  return target;
}
215060
public function extend($target)
    {
        if (!$target || is_scalar($target)) {
            $target = [];
        }

        $args = func_get_args();
        $isArr = is_array($target) || $target instanceof \ArrayAccess;
        $isObj = !$isArr && is_object($target);

        foreach ($args as $obj) {
            if (!$obj || (!is_array($obj) && !is_object($obj))) {
                continue;
            }
            $obj = $obj instanceof \Iterator ? $obj : (array)$obj;
            foreach ($obj as $k => $v) {
                if ($isArr) {
                    $target[$k] = $v;
                } elseif ($isObj) {
                    $target->$k = $v;
                } else {
                    // skip
                }
            }
        }

        return $target;
    }
703861
function (target, props) {
		$.extend(target, props);
		for (var name in props) {
			if (props[name] === null || props[name] === undefined) {
				target[name] = props[name];
			}
		}
		return target;
	}
1017000
function extend(a, b) {
        for (var i in b) {
            if (b.hasOwnProperty(i)) {
                a[i] = b[i];
            }
        }

        if (b.hasOwnProperty("toString")) {
            a.toString = b.toString;
        }

        if (b.hasOwnProperty("valueOf")) {
            a.valueOf = b.valueOf;
        }

        return a;
    }
115347
function extend(a, b, noClone) { // A extends B
    a = a || {};

    if (typeof a !== 'object') {
        return noClone ? b : clone(b);
    }

    if (typeof b !== 'object') {
        return b;
    }

    if (!noClone) {
        a = clone(a);
    }

    Object.keys(b).forEach(function (key) {
        if (!a.hasOwnProperty(key) ||
            (!(typeof b[key] === 'object' && b[key].length === undefined && b[key].constructor.name === 'Folder') &&
                (typeof b[key] !== 'function'))) { // Simple types
            a[key] = b[key];
        } else { // Complex types
            a[key] = extend(a[key], b[key], noClone);
        }
    });
    return a;
}
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
}
1239649
function extend(helper = {}) {
  Object.keys(plugins).forEach((key) => {
    const plugin = plugins[key]
    helper[key] = plugin.default.bind(helper)
  })
  helper.extend = (name, method) => {
    helper[name] = method.bind(helper)
  }
}
1147183
function extend(target, 
// tslint:disable-next-line:trailing-comma
...sources) {
    if (target == null)
        target = {};
    for (const source of sources) {
        for (const [prop, val] of entries(source)) {
            if (val === null) {
                // copy null values
                target[prop] = val;
            }
            else if (typeof target[prop] === "object" && typeof val === "object") {
                // merge objects if both properties are objects
                target[prop] = extend(target[prop], val);
            }
            else if (typeof val === "object") {
                // create a copy of the source object if the target is primitive
                target[prop] = extend({}, val);
            }
            else {
                // copy primitive values
                target[prop] = val;
            }
        }
    }
    return target;
}
294081
function _extend (target, source, deep) {
  for (let key in source) {
    if (deep) {
      if (isPlainObject(source[key])) {
        !isPlainObject(target[key]) && (target[key] = {})
      } else if (Array.isArray(source[key])) {
        !Array.isArray(target[key]) && (target[key] = [])
      } else {
        source[key] !== undefined && (target[key] = source[key])
        continue
      }
      _extend(target[key], source[key], deep)
    } else if (source[key] !== undefined) {
      target[key] = source[key]
    }
  }
}
305186
function extend(prototype, attributes) {
    var object = {};
    Object.keys(prototype).forEach(function(key) {
      object[key] = prototype[key];
    });
    Object.keys(attributes).forEach(function(key) {
      object[key] = attributes[key];
    });
    return object;
  }