mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Rebuild dist. [ci skip]
This commit is contained in:
71
dist/lodash.compat.js
vendored
71
dist/lodash.compat.js
vendored
@@ -2418,7 +2418,7 @@
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
@@ -2472,7 +2472,7 @@
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
@@ -2511,6 +2511,9 @@
|
||||
/**
|
||||
* Gets the first element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.take` and `_.takeWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias head
|
||||
@@ -2565,7 +2568,7 @@
|
||||
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
@@ -2649,6 +2652,9 @@
|
||||
/**
|
||||
* Gets all but the last element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.dropRight` and `_.dropRightWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
@@ -2740,6 +2746,9 @@
|
||||
/**
|
||||
* Gets the last element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.takeRight` and `_.takeRightWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
@@ -2860,7 +2869,7 @@
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the array of removed elements.
|
||||
* @example
|
||||
@@ -2894,6 +2903,9 @@
|
||||
/**
|
||||
* Gets all but the first element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.drop` and `_.dropWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias tail
|
||||
@@ -2983,7 +2995,7 @@
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
@@ -3208,7 +3220,7 @@
|
||||
* @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new duplicate-value-free array.
|
||||
* @example
|
||||
@@ -3615,7 +3627,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -3652,7 +3664,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if all elements passed the predicate check,
|
||||
* else `false`.
|
||||
@@ -3714,7 +3726,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
@@ -3778,7 +3790,7 @@
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -3821,7 +3833,7 @@
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -3929,7 +3941,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -3972,7 +3984,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -4050,7 +4062,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
* @example
|
||||
@@ -4108,7 +4120,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {*} Returns the maximum value.
|
||||
* @example
|
||||
@@ -4183,7 +4195,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {*} Returns the minimum value.
|
||||
* @example
|
||||
@@ -4257,7 +4269,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the array of grouped elements.
|
||||
* @example
|
||||
@@ -4410,7 +4422,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
@@ -4545,7 +4557,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if any element passed the predicate check,
|
||||
* else `false`.
|
||||
@@ -4611,7 +4623,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function
|
||||
* called per iteration. If a property name or object is provided it will
|
||||
* be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* be used to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
* @example
|
||||
@@ -5201,13 +5213,14 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that negates the result of `func`. The `func` function
|
||||
* is executed with the `this` binding and arguments of the created function.
|
||||
* Creates a function that negates the result of the predicate `func`. The
|
||||
* `func` function is executed with the `this` binding and arguments of the
|
||||
* created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to negate.
|
||||
* @param {Function} predicate The predicate to negate.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
@@ -5218,12 +5231,12 @@
|
||||
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
|
||||
* // => [1, 3, 5]
|
||||
*/
|
||||
function negate(func) {
|
||||
if (!isFunction(func)) {
|
||||
function negate(predicate) {
|
||||
if (!isFunction(predicate)) {
|
||||
throw new TypeError;
|
||||
}
|
||||
return function() {
|
||||
return !func.apply(this, arguments);
|
||||
return !predicate.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5664,7 +5677,7 @@
|
||||
* @param {Object} object The object to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -5710,7 +5723,7 @@
|
||||
* @param {Object} object The object to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -6542,7 +6555,7 @@
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the new mapped object.
|
||||
* @example
|
||||
|
||||
71
dist/lodash.js
vendored
71
dist/lodash.js
vendored
@@ -2243,7 +2243,7 @@
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
@@ -2297,7 +2297,7 @@
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
@@ -2336,6 +2336,9 @@
|
||||
/**
|
||||
* Gets the first element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.take` and `_.takeWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias head
|
||||
@@ -2390,7 +2393,7 @@
|
||||
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
@@ -2474,6 +2477,9 @@
|
||||
/**
|
||||
* Gets all but the last element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.dropRight` and `_.dropRightWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
@@ -2565,6 +2571,9 @@
|
||||
/**
|
||||
* Gets the last element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.takeRight` and `_.takeRightWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
@@ -2685,7 +2694,7 @@
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the array of removed elements.
|
||||
* @example
|
||||
@@ -2719,6 +2728,9 @@
|
||||
/**
|
||||
* Gets all but the first element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.drop` and `_.dropWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias tail
|
||||
@@ -2808,7 +2820,7 @@
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
@@ -3033,7 +3045,7 @@
|
||||
* @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new duplicate-value-free array.
|
||||
* @example
|
||||
@@ -3437,7 +3449,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -3474,7 +3486,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if all elements passed the predicate check,
|
||||
* else `false`.
|
||||
@@ -3536,7 +3548,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
@@ -3600,7 +3612,7 @@
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -3645,7 +3657,7 @@
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -3756,7 +3768,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -3799,7 +3811,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -3877,7 +3889,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
* @example
|
||||
@@ -3936,7 +3948,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {*} Returns the maximum value.
|
||||
* @example
|
||||
@@ -4011,7 +4023,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {*} Returns the minimum value.
|
||||
* @example
|
||||
@@ -4085,7 +4097,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the array of grouped elements.
|
||||
* @example
|
||||
@@ -4238,7 +4250,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
@@ -4371,7 +4383,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if any element passed the predicate check,
|
||||
* else `false`.
|
||||
@@ -4437,7 +4449,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function
|
||||
* called per iteration. If a property name or object is provided it will
|
||||
* be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* be used to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
* @example
|
||||
@@ -5025,13 +5037,14 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that negates the result of `func`. The `func` function
|
||||
* is executed with the `this` binding and arguments of the created function.
|
||||
* Creates a function that negates the result of the predicate `func`. The
|
||||
* `func` function is executed with the `this` binding and arguments of the
|
||||
* created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to negate.
|
||||
* @param {Function} predicate The predicate to negate.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
@@ -5042,12 +5055,12 @@
|
||||
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
|
||||
* // => [1, 3, 5]
|
||||
*/
|
||||
function negate(func) {
|
||||
if (!isFunction(func)) {
|
||||
function negate(predicate) {
|
||||
if (!isFunction(predicate)) {
|
||||
throw new TypeError;
|
||||
}
|
||||
return function() {
|
||||
return !func.apply(this, arguments);
|
||||
return !predicate.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5488,7 +5501,7 @@
|
||||
* @param {Object} object The object to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -5534,7 +5547,7 @@
|
||||
* @param {Object} object The object to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {string|undefined} Returns the key of the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -6317,7 +6330,7 @@
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the new mapped object.
|
||||
* @example
|
||||
|
||||
59
dist/lodash.underscore.js
vendored
59
dist/lodash.underscore.js
vendored
@@ -1229,7 +1229,7 @@
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
@@ -1269,6 +1269,9 @@
|
||||
/**
|
||||
* Gets the first element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.take` and `_.takeWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias head
|
||||
@@ -1311,7 +1314,7 @@
|
||||
* @param {boolean} [isShallow=false] A flag to restrict flattening to a single level.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @example
|
||||
@@ -1384,6 +1387,9 @@
|
||||
/**
|
||||
* Gets all but the last element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.dropRight` and `_.dropRightWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
@@ -1451,6 +1457,9 @@
|
||||
/**
|
||||
* Gets the last element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.takeRight` and `_.takeRightWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
@@ -1508,6 +1517,9 @@
|
||||
/**
|
||||
* Gets all but the first element of `array`.
|
||||
*
|
||||
* Note: The `n` and `predicate` arguments are deprecated; replace with
|
||||
* `_.drop` and `_.dropWhile` respectively.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias tail
|
||||
@@ -1588,7 +1600,7 @@
|
||||
* @param {*} value The value to evaluate.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {number} Returns the index at which `value` should be inserted
|
||||
* into `array`.
|
||||
@@ -1701,7 +1713,7 @@
|
||||
* @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new duplicate-value-free array.
|
||||
* @example
|
||||
@@ -2002,7 +2014,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -2039,7 +2051,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if all elements passed the predicate check,
|
||||
* else `false`.
|
||||
@@ -2101,7 +2113,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
@@ -2165,7 +2177,7 @@
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {*} Returns the found element, else `undefined`.
|
||||
* @example
|
||||
@@ -2263,7 +2275,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -2306,7 +2318,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @example
|
||||
@@ -2384,7 +2396,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
* @example
|
||||
@@ -2443,7 +2455,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {*} Returns the maximum value.
|
||||
* @example
|
||||
@@ -2516,7 +2528,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback] The function called per iteration.
|
||||
* If a property name or object is provided it will be used to create a "_.pluck"
|
||||
* or "_.where" style callback, respectively.
|
||||
* or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {*} Returns the minimum value.
|
||||
* @example
|
||||
@@ -2588,7 +2600,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the array of grouped elements.
|
||||
* @example
|
||||
@@ -2741,7 +2753,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @example
|
||||
@@ -2874,7 +2886,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [predicate=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `predicate`.
|
||||
* @returns {boolean} Returns `true` if any element passed the predicate check,
|
||||
* else `false`.
|
||||
@@ -2940,7 +2952,7 @@
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function
|
||||
* called per iteration. If a property name or object is provided it will
|
||||
* be used to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* be used to create a "_.pluck" or "_.where" style callback respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
* @example
|
||||
@@ -3430,13 +3442,14 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that negates the result of `func`. The `func` function
|
||||
* is executed with the `this` binding and arguments of the created function.
|
||||
* Creates a function that negates the result of the predicate `func`. The
|
||||
* `func` function is executed with the `this` binding and arguments of the
|
||||
* created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Function} func The function to negate.
|
||||
* @param {Function} predicate The predicate to negate.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
@@ -3447,12 +3460,12 @@
|
||||
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
|
||||
* // => [1, 3, 5]
|
||||
*/
|
||||
function negate(func) {
|
||||
if (!isFunction(func)) {
|
||||
function negate(predicate) {
|
||||
if (!isFunction(predicate)) {
|
||||
throw new TypeError;
|
||||
}
|
||||
return function() {
|
||||
return !func.apply(this, arguments);
|
||||
return !predicate.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user