mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Rebuild lodash and docs.
This commit is contained in:
51
dist/lodash.js
vendored
51
dist/lodash.js
vendored
@@ -12,7 +12,7 @@
|
||||
var undefined;
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.16.2';
|
||||
var VERSION = '4.16.3';
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
@@ -95,6 +95,7 @@
|
||||
numberTag = '[object Number]',
|
||||
objectTag = '[object Object]',
|
||||
promiseTag = '[object Promise]',
|
||||
proxyTag = '[object Proxy]',
|
||||
regexpTag = '[object RegExp]',
|
||||
setTag = '[object Set]',
|
||||
stringTag = '[object String]',
|
||||
@@ -1469,7 +1470,6 @@
|
||||
Symbol = context.Symbol,
|
||||
Uint8Array = context.Uint8Array,
|
||||
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
|
||||
defineProperty = Object.defineProperty,
|
||||
getPrototype = overArg(Object.getPrototypeOf, Object),
|
||||
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
||||
objectCreate = Object.create,
|
||||
@@ -1477,6 +1477,14 @@
|
||||
splice = arrayProto.splice,
|
||||
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
||||
|
||||
var defineProperty = (function() {
|
||||
try {
|
||||
var func = getNative(Object, 'defineProperty');
|
||||
func({}, '', {});
|
||||
return func;
|
||||
} catch (e) {}
|
||||
}());
|
||||
|
||||
/** Mocked built-ins. */
|
||||
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
|
||||
ctxNow = Date && Date.now !== root.Date.now && Date.now,
|
||||
@@ -1503,8 +1511,7 @@
|
||||
Promise = getNative(context, 'Promise'),
|
||||
Set = getNative(context, 'Set'),
|
||||
WeakMap = getNative(context, 'WeakMap'),
|
||||
nativeCreate = getNative(Object, 'create'),
|
||||
nativeDefineProperty = getNative(Object, 'defineProperty');
|
||||
nativeCreate = getNative(Object, 'create');
|
||||
|
||||
/** Used to store function metadata. */
|
||||
var metaMap = WeakMap && new WeakMap;
|
||||
@@ -1672,7 +1679,7 @@
|
||||
if (objectCreate) {
|
||||
return objectCreate(proto);
|
||||
}
|
||||
object.prototype = prototype;
|
||||
object.prototype = proto;
|
||||
var result = new object;
|
||||
object.prototype = undefined;
|
||||
return result;
|
||||
@@ -2462,7 +2469,7 @@
|
||||
*/
|
||||
function assignMergeValue(object, key, value) {
|
||||
if ((value !== undefined && !eq(object[key], value)) ||
|
||||
(typeof key == 'number' && value === undefined && !(key in object))) {
|
||||
(value === undefined && !(key in object))) {
|
||||
baseAssignValue(object, key, value);
|
||||
}
|
||||
}
|
||||
@@ -3271,6 +3278,13 @@
|
||||
othIsObj = othTag == objectTag,
|
||||
isSameTag = objTag == othTag;
|
||||
|
||||
if (isSameTag && isBuffer(object)) {
|
||||
if (!isBuffer(other)) {
|
||||
return false;
|
||||
}
|
||||
objIsArr = true;
|
||||
objIsObj = false;
|
||||
}
|
||||
if (isSameTag && !objIsObj) {
|
||||
stack || (stack = new Stack);
|
||||
return (objIsArr || isTypedArray(object))
|
||||
@@ -3616,29 +3630,32 @@
|
||||
var isCommon = newValue === undefined;
|
||||
|
||||
if (isCommon) {
|
||||
var isArr = isArray(srcValue),
|
||||
isTyped = !isArr && isTypedArray(srcValue);
|
||||
|
||||
newValue = srcValue;
|
||||
if (isArray(srcValue) || isTypedArray(srcValue)) {
|
||||
if (isArr || isTyped) {
|
||||
if (isArray(objValue)) {
|
||||
newValue = objValue;
|
||||
}
|
||||
else if (isArrayLikeObject(objValue)) {
|
||||
newValue = copyArray(objValue);
|
||||
}
|
||||
else {
|
||||
else if (isTyped) {
|
||||
isCommon = false;
|
||||
newValue = baseClone(srcValue, true);
|
||||
newValue = cloneTypedArray(srcValue, true);
|
||||
}
|
||||
else {
|
||||
newValue = [];
|
||||
}
|
||||
}
|
||||
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||
newValue = objValue;
|
||||
if (isArguments(objValue)) {
|
||||
newValue = toPlainObject(objValue);
|
||||
}
|
||||
else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
|
||||
isCommon = false;
|
||||
newValue = baseClone(srcValue, true);
|
||||
}
|
||||
else {
|
||||
newValue = objValue;
|
||||
newValue = initCloneObject(srcValue);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -3984,8 +4001,8 @@
|
||||
* @param {Function} string The `toString` result.
|
||||
* @returns {Function} Returns `func`.
|
||||
*/
|
||||
var baseSetToString = !nativeDefineProperty ? identity : function(func, string) {
|
||||
return nativeDefineProperty(func, 'toString', {
|
||||
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
||||
return defineProperty(func, 'toString', {
|
||||
'configurable': true,
|
||||
'enumerable': false,
|
||||
'value': constant(string),
|
||||
@@ -11555,7 +11572,7 @@
|
||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||
return tag == funcTag || tag == genTag;
|
||||
return tag == funcTag || tag == genTag || tag == proxyTag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user