mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Rebuild dist.
This commit is contained in:
93
dist/lodash.compat.js
vendored
93
dist/lodash.compat.js
vendored
@@ -44,8 +44,9 @@
|
||||
reInterpolate = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals
|
||||
* Used to match ES6 template delimiters.
|
||||
* See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components)
|
||||
* for more details.
|
||||
*/
|
||||
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
||||
|
||||
@@ -451,7 +452,7 @@
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a DOM node, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a DOM node, else `false`.
|
||||
*/
|
||||
function isNode(value) {
|
||||
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
|
||||
@@ -616,6 +617,9 @@
|
||||
/** Used to restore the original `_` reference in `noConflict` */
|
||||
var oldDash = context._;
|
||||
|
||||
/** Used as the maximum value returned by `toLength` */
|
||||
var maxSafeInteger = Math.pow(2, 53) - 1;
|
||||
|
||||
/** Used to resolve the internal [[Class]] of values */
|
||||
var toString = objectProto.toString;
|
||||
|
||||
@@ -867,7 +871,7 @@
|
||||
* @memberOf _.support
|
||||
* @type boolean
|
||||
*/
|
||||
support.nonEnumArgs = key != 0;
|
||||
support.nonEnumArgs = key != '0';
|
||||
|
||||
/**
|
||||
* Detect if properties shadowing those on `Object.prototype` are non-enumerable.
|
||||
@@ -1340,8 +1344,8 @@
|
||||
iterable = collection,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
if (typeof length == 'number' && length > -1) {
|
||||
length |= 0;
|
||||
if (typeof length == 'number') {
|
||||
length = toLength(length);
|
||||
if (support.unindexedChars && isString(iterable)) {
|
||||
iterable = iterable.split('');
|
||||
}
|
||||
@@ -1369,8 +1373,8 @@
|
||||
var iterable = collection,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
if (typeof length == 'number' && length > -1) {
|
||||
length = (length |= 0) < 0 ? 0 : length;
|
||||
if (typeof length == 'number') {
|
||||
length = toLength(length);
|
||||
if (support.unindexedChars && isString(iterable)) {
|
||||
iterable = iterable.split('');
|
||||
}
|
||||
@@ -2100,7 +2104,7 @@
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a native function, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
|
||||
*/
|
||||
function isNative(value) {
|
||||
return typeof value == 'function' && reNative.test(fnToString.call(value));
|
||||
@@ -2159,14 +2163,11 @@
|
||||
return typeof result == 'undefined' || hasOwnProperty.call(value, result);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* A fallback implementation of `Object.keys` which creates an array of the
|
||||
* own enumerable property names of `object`.
|
||||
*
|
||||
* @private
|
||||
* @type Function
|
||||
* @param {Object} object The object to inspect.
|
||||
* @returns {Array} Returns the array of property names.
|
||||
*/
|
||||
@@ -2185,6 +2186,20 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts `value` to an integer suitable for use as the length of an array-like
|
||||
* object. See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
|
||||
* for more details.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {number} Returns the converted integer.
|
||||
*/
|
||||
function toLength(value) {
|
||||
var result = +value || 0;
|
||||
return result < 0 ? 0 : (result < maxSafeInteger ? result : maxSafeInteger);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -3539,7 +3554,7 @@
|
||||
* // => true
|
||||
*/
|
||||
function contains(collection, target, fromIndex) {
|
||||
var length = (length = collection && collection.length, length > -1 && length >>> 0);
|
||||
var length = toLength(collection && collection.length);
|
||||
fromIndex = (typeof fromIndex == 'number' && +fromIndex) || 0;
|
||||
|
||||
if (length) {
|
||||
@@ -3972,10 +3987,10 @@
|
||||
});
|
||||
|
||||
/**
|
||||
* Invokes the method named by `methodName` on each element in the `collection`
|
||||
* Invokes the method named by `methodName` on each element in the collection
|
||||
* returning an array of the results of each invoked method. Additional arguments
|
||||
* will be provided to each invoked method. If `methodName` is a function it
|
||||
* will be invoked for, and `this` bound to, each element in the `collection`.
|
||||
* will be invoked for, and `this` bound to, each element in the collection.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -4436,7 +4451,7 @@
|
||||
collection = collection.split('');
|
||||
}
|
||||
if (n == null || guard) {
|
||||
var length = (length = collection && collection.length, length > -1 && length >>> 0);
|
||||
var length = toLength(collection && collection.length);
|
||||
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
|
||||
}
|
||||
var result = shuffle(collection);
|
||||
@@ -4474,7 +4489,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the size of the `collection` by returning `collection.length` for arrays
|
||||
* Gets the size of the collection by returning `collection.length` for arrays
|
||||
* and array-like objects or the number of own enumerable properties for objects.
|
||||
*
|
||||
* @static
|
||||
@@ -4642,7 +4657,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the `collection` to an array.
|
||||
* Converts `collection` to an array.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -4666,7 +4681,7 @@
|
||||
|
||||
/**
|
||||
* Performs a deep comparison between each element in `collection` and the
|
||||
* `source` object, returning an array of all elements that have equivalent
|
||||
* source object, returning an array of all elements that have equivalent
|
||||
* property values.
|
||||
*
|
||||
* @static
|
||||
@@ -4694,7 +4709,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a function that executes `func`, with the `this` binding and
|
||||
* Creates a function that executes `func`, with the `this` binding and
|
||||
* arguments of the created function, only after being called `n` times.
|
||||
*
|
||||
* @static
|
||||
@@ -5733,7 +5748,6 @@
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Objects
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} [callback=identity] The function called per iteration.
|
||||
@@ -5937,7 +5951,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`.
|
||||
* @example
|
||||
*
|
||||
* (function() { return _.isArguments(arguments); })();
|
||||
@@ -5963,10 +5977,9 @@
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @type Function
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is an array, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isArray([1, 2, 3]);
|
||||
@@ -5987,7 +6000,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a boolean value, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isBoolean(false);
|
||||
@@ -6008,7 +6021,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a date, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a date, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isDate(new Date);
|
||||
@@ -6028,7 +6041,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isElement(document.body);
|
||||
@@ -6058,7 +6071,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Array|Object|string} value The value to inspect.
|
||||
* @returns {boolean} Returns `true` if the `value` is empty, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isEmpty(null);
|
||||
@@ -6165,7 +6178,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is finite, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is finite, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isFinite(-101);
|
||||
@@ -6194,7 +6207,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a function, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isFunction(_);
|
||||
@@ -6221,7 +6234,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is an object, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isObject({});
|
||||
@@ -6253,7 +6266,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isNaN(NaN);
|
||||
@@ -6281,7 +6294,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is `null`, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is `null`, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isNull(null);
|
||||
@@ -6304,7 +6317,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a number, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isNumber(8.4);
|
||||
@@ -6365,7 +6378,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a regular expression, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isRegExp(/abc/);
|
||||
@@ -6387,7 +6400,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is a string, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isString('abc');
|
||||
@@ -6408,7 +6421,7 @@
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`.
|
||||
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.isUndefined(void 0);
|
||||
@@ -7830,8 +7843,8 @@
|
||||
|
||||
/**
|
||||
* Converts `value` to an integer of the specified radix. If `radix` is
|
||||
* `undefined` or `0` a `radix` of `10` is used unless the `value` is a
|
||||
* hexadecimal, in which case a `radix` of `16` is used.
|
||||
* `undefined` or `0` a `radix` of `10` is used unless `value` is a hexadecimal,
|
||||
* in which case a `radix` of `16` is used.
|
||||
*
|
||||
* Note: This method avoids differences in native ES3 and ES5 `parseInt`
|
||||
* implementations. See the [ES5 spec](http://es5.github.io/#E)
|
||||
@@ -7842,7 +7855,7 @@
|
||||
* @category Utilities
|
||||
* @param {string} value The value to parse.
|
||||
* @param {number} [radix] The radix used to interpret the value to parse.
|
||||
* @returns {number} Returns the converted integer value.
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @example
|
||||
*
|
||||
* _.parseInt('08');
|
||||
|
||||
Reference in New Issue
Block a user