Rebuild dist.

This commit is contained in:
John-David Dalton
2014-03-14 01:32:19 -07:00
parent 4a66e28584
commit 5d89fa3f07
6 changed files with 316 additions and 277 deletions

109
dist/lodash.js vendored
View File

@@ -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;
@@ -594,6 +595,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;
@@ -1183,8 +1187,8 @@
iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1) {
length |= 0;
if (typeof length == 'number') {
length = toLength(length);
while (++index < length) {
if (callback(iterable[index], index, collection) === false) {
break;
@@ -1209,8 +1213,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);
while (length--) {
if (callback(iterable[length], length, collection) === false) {
break;
@@ -1757,7 +1761,7 @@
callback = lodash.createCallback(callback, thisArg, 3);
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
if (length) {
while (++index < length) {
@@ -1937,7 +1941,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));
@@ -1984,14 +1988,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.
*/
@@ -2010,6 +2011,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);
}
/*--------------------------------------------------------------------------*/
/**
@@ -3361,7 +3376,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) {
@@ -3473,7 +3488,7 @@
predicate = lodash.createCallback(predicate, thisArg, 3);
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
if (length) {
while (++index < length) {
@@ -3534,7 +3549,7 @@
predicate = lodash.createCallback(predicate, thisArg, 3);
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
if (length) {
while (++index < length) {
@@ -3597,7 +3612,7 @@
* // => { 'name': 'fred', 'age': 40, 'blocked': true }
*/
function find(collection, predicate, thisArg) {
var length = (length = collection && collection.length, length > -1 && length >>> 0);
var length = toLength(collection && collection.length);
if (length) {
var index = findIndex(collection, predicate, thisArg);
return index > -1 ? collection[index] : undefined;
@@ -3627,7 +3642,7 @@
* // => 3
*/
function findLast(collection, predicate, thisArg) {
var length = (length = collection && collection.length, length > -1 && length >>> 0);
var length = toLength(collection && collection.length);
if (length) {
var index = findLastIndex(collection, predicate, thisArg);
return index > -1 ? collection[index] : undefined;
@@ -3664,7 +3679,7 @@
*/
function forEach(collection, callback, thisArg) {
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);
if (length) {
@@ -3697,7 +3712,7 @@
* // => logs each number from right to left and returns '3,2,1'
*/
function forEachRight(collection, callback, thisArg) {
var length = (length = collection && collection.length, length > -1 && length >>> 0);
var length = toLength(collection && collection.length);
callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3);
if (length) {
@@ -3799,10 +3814,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 _
@@ -3874,7 +3889,7 @@
*/
function map(collection, callback, thisArg) {
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
callback = lodash.createCallback(callback, thisArg, 3);
if (length) {
@@ -4146,7 +4161,7 @@
callback = lodash.createCallback(callback, thisArg, 4);
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
if (length) {
if (noaccum && length) {
@@ -4262,7 +4277,7 @@
collection = values(collection);
}
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);
@@ -4300,7 +4315,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
@@ -4371,7 +4386,7 @@
predicate = lodash.createCallback(predicate, thisArg, 3);
var index = -1,
length = (length = collection && collection.length, length > -1 && length >>> 0);
length = toLength(collection && collection.length);
if (length) {
while (++index < length) {
@@ -4468,7 +4483,7 @@
}
/**
* Converts the `collection` to an array.
* Converts `collection` to an array.
*
* @static
* @memberOf _
@@ -4490,7 +4505,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
@@ -4518,7 +4533,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
@@ -5557,7 +5572,6 @@
*
* @static
* @memberOf _
* @type Function
* @category Objects
* @param {Object} object The object to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
@@ -5761,7 +5775,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); })();
@@ -5780,10 +5794,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]);
@@ -5804,7 +5817,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);
@@ -5825,7 +5838,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);
@@ -5845,7 +5858,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);
@@ -5875,7 +5888,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);
@@ -5981,7 +5994,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);
@@ -6010,7 +6023,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(_);
@@ -6031,7 +6044,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({});
@@ -6063,7 +6076,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);
@@ -6091,7 +6104,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);
@@ -6114,7 +6127,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);
@@ -6175,7 +6188,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/);
@@ -6195,7 +6208,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');
@@ -6216,7 +6229,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);
@@ -7605,8 +7618,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)
@@ -7617,7 +7630,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');