Doc tweak standardizing on "invoke" and "call". [ci skip]

This commit is contained in:
John-David Dalton
2014-08-24 12:08:46 -07:00
parent b48b454909
commit c17e1f9e75

278
lodash.js
View File

@@ -492,7 +492,7 @@
* given string.
*
* @private
* @param {Function} callback The function called to combine each word.
* @param {Function} callback The function invoked to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
@@ -1106,7 +1106,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEach(array, iteratee) {
@@ -1127,7 +1127,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
@@ -1147,7 +1147,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns `true` if all elements passed the predicate check,
* else `false`
*/
@@ -1169,7 +1169,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
@@ -1189,7 +1189,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
@@ -1213,7 +1213,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initFromArray=false] Specify using the first element of
* `array` as the initial value.
@@ -1238,7 +1238,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {boolean} [initFromArray=false] Specify using the last element of
* `array` as the initial value.
@@ -1262,7 +1262,7 @@
*
* @private
* @param {Array} array The array to iterate over.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passed the predicate check,
* else `false`.
*/
@@ -1568,7 +1568,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object|string} Returns `collection`.
*/
function baseEach(collection, iteratee) {
@@ -1593,7 +1593,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array|Object|string} Returns `collection`.
*/
function baseEachRight(collection, iteratee) {
@@ -1616,7 +1616,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns `true` if all elements passed the predicate check,
* else `false`
*/
@@ -1636,7 +1636,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function baseFilter(collection, predicate) {
@@ -1657,7 +1657,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to search.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @param {Function} eachFunc The function to iterate over `collection`.
* @param {boolean} [retKey=false] Specify returning the key of the found
* element instead of the element itself.
@@ -1717,13 +1717,13 @@
/**
* The base implementation of `baseForIn` and `baseForOwn` which iterates
* over `object` properties returned by `keysFunc` executing `iteratee` for
* over `object` properties returned by `keysFunc` invoking `iteratee` for
* each property. Iterator functions may exit iteration early by explicitly
* returning `false`.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
@@ -1747,7 +1747,7 @@
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
@@ -1770,7 +1770,7 @@
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForIn(object, iteratee) {
@@ -1783,7 +1783,7 @@
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
@@ -1796,7 +1796,7 @@
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwnRight(object, iteratee) {
@@ -2058,7 +2058,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function baseMap(collection, iteratee) {
@@ -2202,7 +2202,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @param {*} accumulator The initial value.
* @param {boolean} initFromCollection Specify using the first or last element
* of `collection` as the initial value.
@@ -2246,7 +2246,7 @@
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passed the predicate check,
* else `false`.
*/
@@ -2267,7 +2267,7 @@
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to evaluate.
* @param {Function} iteratee The function called per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @param {boolean} [retHighest=false] Specify returning the highest, instead
* of the lowest, index at which a value should be inserted into `array`.
* @returns {number} Returns the index at which `value` should be inserted
@@ -2305,7 +2305,7 @@
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The function called per iteration.
* @param {Function} [iteratee] The function invoked per iteration.
* @returns {Array} Returns the new duplicate-value-free array.
*/
function baseUniq(array, iteratee) {
@@ -2813,7 +2813,7 @@
* Gets the appropriate "callback" function. If the `_.callback` method is
* customized this function returns the custom method, otherwise it returns
* the `baseCallback` function. If arguments are provided the chosen function
* is executed with the arguments and its result is returned.
* is invoked with them and its result is returned.
*
* @private
* @returns {Function} Returns the chosen function or its result.
@@ -2845,7 +2845,7 @@
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
* customized this function returns the custom method, otherwise it returns
* the `baseIndexOf` function. If arguments are provided the chosen function
* is executed with the arguments and its result is returned.
* is invoked with them and its result is returned.
*
* @private
* @returns {Function|number} Returns the chosen function or its result.
@@ -2991,7 +2991,7 @@
*
* @private
* @param {Object} object The source object.
* @param {Function} predicate The function called per iteration.
* @param {Function} predicate The function invoked per iteration.
* @returns {Object} Returns the new object.
*/
function pickByCallback(object, predicate) {
@@ -3032,7 +3032,7 @@
/**
* Sets metadata for `func`.
*
* **Note:** If this function becomes hot, i.e. is called a lot in a short
* **Note:** If this function becomes hot, i.e. is invoked a lot in a short
* period of time, it will trip its breaker and transition to an identity
* function to avoid garbage collection pauses.
*
@@ -3138,7 +3138,7 @@
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The function called per iteration.
* @param {Function} [iteratee] The function invoked per iteration.
* @returns {Array} Returns the new duplicate-value-free array.
*/
function sortedUniq(array, iteratee) {
@@ -3370,7 +3370,7 @@
* @type Function
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per element.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
@@ -3419,7 +3419,7 @@
* @type Function
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per element.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
@@ -3466,7 +3466,7 @@
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -3520,7 +3520,7 @@
* @memberOf _
* @category Array
* @param {Array} array The array to search.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -3902,7 +3902,7 @@
* @memberOf _
* @category Array
* @param {Array} array The array to modify.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -3994,7 +3994,7 @@
/**
* Uses a binary search to determine the lowest index at which a value should
* be inserted into a given sorted array in order to maintain the sort order
* of the array. If an iteratee function is provided it is executed for `value`
* of the array. If an iteratee function is provided it is invoked for `value`
* and each element of `array` to compute their sort ranking. The iteratee
* function is bound to `thisArg` and invoked with one argument; (value).
*
@@ -4010,7 +4010,7 @@
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -4051,7 +4051,7 @@
* @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -4146,7 +4146,7 @@
* @type Function
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per element.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
@@ -4195,7 +4195,7 @@
* @type Function
* @category Array
* @param {Array} array The array to query.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per element.
* @param {*} [thisArg] The `this` binding of `predicate`.
* @returns {Array} Returns the slice of `array`.
@@ -4253,7 +4253,7 @@
* Creates a duplicate-value-free version of an array using `SameValueZero`
* for equality comparisons. Providing `true` for `isSorted` performs a faster
* search algorithm for sorted arrays. If an iteratee function is provided it
* is executed for each value in the array to generate the criterion by which
* is invoked for each value in the array to generate the criterion by which
* uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
* with three arguments; (value, index, array).
*
@@ -4274,7 +4274,7 @@
* @category Array
* @param {Array} array The array to inspect.
* @param {boolean} [isSorted=false] Specify the array is sorted.
* @param {Function|Object|string} [iteratee] The function called per iteration.
* @param {Function|Object|string} [iteratee] The function invoked per iteration.
* If a property name or object is provided it is used to create a "_.pluck"
* or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -4685,7 +4685,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -4722,7 +4722,7 @@
* @alias all
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -4771,7 +4771,7 @@
* @alias select
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -4818,7 +4818,7 @@
* @alias detect
* @category Collection
* @param {Array|Object|string} collection The collection to search.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -4861,7 +4861,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to search.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -4905,8 +4905,8 @@
}
/**
* Iterates over elements of `collection` executing `iteratee` for each
* element. The `iteratee` is bound to `thisArg` and invoked with three arguments;
* Iterates over elements of `collection` invoking `iteratee` for each element.
* The `iteratee` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection). Iterator functions may exit iteration early
* by explicitly returning `false`.
*
@@ -4919,7 +4919,7 @@
* @alias each
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Array|Object|string} Returns `collection`.
* @example
@@ -4945,7 +4945,7 @@
* @alias eachRight
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Array|Object|string} Returns `collection`.
* @example
@@ -4977,7 +4977,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -5020,7 +5020,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -5047,9 +5047,9 @@
/**
* Invokes the method named by `methodName` on each element in the collection,
* returning an array of the results of each invoked method. Additional arguments
* is provided to each invoked method. If `methodName` is a function it is
* invoked for, and `this` bound to, each element in the collection.
* returning an array of the results of each invoked method. Any additional
* arguments are provided to each invoked method. If `methodName` is a function
* it is invoked for, and `this` bound to, each element in the collection.
*
* @static
* @memberOf _
@@ -5088,7 +5088,7 @@
* @alias collect
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -5120,7 +5120,7 @@
/**
* Retrieves the maximum value of `collection`. If the collection is empty
* or falsey `-Infinity` is returned. If an iteratee function is provided it
* is executed for each value in the collection to generate the criterion by
* is invoked for each value in the collection to generate the criterion by
* which the value is ranked. The `iteratee` is bound to `thisArg` and invoked
* with three arguments; (value, index, collection).
*
@@ -5135,7 +5135,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee] The function called per iteration.
* @param {Function|Object|string} [iteratee] The function invoked per iteration.
* If a property name or object is provided it is used to create a "_.pluck"
* or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -5203,7 +5203,7 @@
/**
* Retrieves the minimum value of `collection`. If the collection is empty
* or falsey `Infinity` is returned. If an iteratee function is provided it
* is executed for each value in the collection to generate the criterion by
* is invoked for each value in the collection to generate the criterion by
* which the value is ranked. The `iteratee` is bound to `thisArg` and invoked
* with three arguments; (value, index, collection).
*
@@ -5218,7 +5218,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [iteratee] The function called per iteration.
* @param {Function|Object|string} [iteratee] The function invoked per iteration.
* If a property name or object is provided it is used to create a "_.pluck"
* or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -5300,7 +5300,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -5357,8 +5357,8 @@
/**
* Reduces a collection to a value which is the accumulated result of running
* each element in the collection through `iteratee`, where each successive
* execution consumes the return value of the previous execution. If `accumulator`
* is not provided the first element of the collection is used as the initial
* invocation consumes the return value of the previous. If `accumulator` is
* not provided the first element of the collection is used as the initial
* value. The `iteratee` is bound to `thisArg`and invoked with four arguments;
* (accumulator, value, index|key, collection).
*
@@ -5367,7 +5367,7 @@
* @alias foldl, inject
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {*} Returns the accumulated value.
@@ -5396,7 +5396,7 @@
* @alias foldr
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [accumulator] The initial value.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {*} Returns the accumulated value.
@@ -5426,7 +5426,7 @@
* @memberOf _
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -5564,7 +5564,7 @@
* @alias any
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -5618,7 +5618,7 @@
* @category Collection
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Array|Function|Object|string} [iteratee=identity] The function
* called per iteration. If property name(s) or an object is provided it
* invoked per iteration. If property name(s) or an object is provided it
* is used to create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Array} Returns the new sorted array.
@@ -5736,13 +5736,13 @@
/*--------------------------------------------------------------------------*/
/**
* The opposite of `_.before`; this method creates a function that executes
* The opposite of `_.before`; this method creates a function that invokes
* `func` only after it is called `n` times.
*
* @static
* @memberOf _
* @category Function
* @param {number} n The number of calls before `func` is executed.
* @param {number} n The number of calls before `func` is invoked.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
@@ -5771,13 +5771,13 @@
}
/**
* Creates a function that executes `func`, with the `this` binding and
* Creates a function that invokes `func`, with the `this` binding and
* arguments of the created function, until it is called `n` times.
*
* @static
* @memberOf _
* @category Function
* @param {number} n The number of times `func` may be executed.
* @param {number} n The number of times `func` may be called.
* @param {Function} func The function to restrict.
* @returns {Function} Returns the new restricted function.
* @example
@@ -6039,14 +6039,14 @@
}
/**
* Creates a function that delays the execution of `func` until after `wait`
* Creates a function that delays the invocation of `func` until after `wait`
* milliseconds have elapsed since the last time it was invoked. The created
* function comes with a `cancel` method to cancel delayed calls. Provide an
* function comes with a `cancel` method to cancel delayed invokes. Provide an
* options object to indicate that `func` should be invoked on the leading
* and/or trailing edge of the `wait` timeout. Subsequent calls to the
* debounced function return the result of the last `func` call.
* debounced function return the result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is called on
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked on
* the trailing edge of the timeout only if the the debounced function is
* invoked more than once during the `wait` timeout.
*
@@ -6059,11 +6059,11 @@
* @param {Function} func The function to debounce.
* @param {number} wait The number of milliseconds to delay.
* @param {Object} [options] The options object.
* @param {boolean} [options.leading=false] Specify execution on the leading
* @param {boolean} [options.leading=false] Specify invoking on the leading
* edge of the timeout.
* @param {number} [options.maxWait] The maximum time `func` is allowed to be
* delayed before it is called.
* @param {boolean} [options.trailing=true] Specify execution on the trailing
* delayed before it is invoked.
* @param {boolean} [options.trailing=true] Specify invoking on the trailing
* edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
@@ -6071,13 +6071,13 @@
* // avoid costly calculations while the window size is in flux
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // execute `sendMail` when the click event is fired, debouncing subsequent calls
* // invoke `sendMail` when the click event is fired, debouncing subsequent calls
* jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* });
*
* // ensure `batchLog` is executed once after 1 second of debounced calls
* // ensure `batchLog` is invoked once after 1 second of debounced calls
* var source = new EventSource('/stream');
* jQuery(source).on('message', _.debounce(batchLog, 250, {
* 'maxWait': 1000
@@ -6215,8 +6215,8 @@
}
/**
* Defers executing the `func` function until the current call stack has
* cleared. Additional arguments are provided to `func` when it is invoked.
* Defers invoking the `func` until the current call stack has cleared. Any
* additional arguments are provided to `func` when it is invoked.
*
* @static
* @memberOf _
@@ -6238,14 +6238,14 @@
}
/**
* Executes the `func` function after `wait` milliseconds. Additional arguments
* are provided to `func` when it is invoked.
* Invokes `func` after `wait` milliseconds. Any additional arguments are
* provided to `func` when it is invoked.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to delay.
* @param {number} wait The number of milliseconds to delay execution.
* @param {number} wait The number of milliseconds to delay invocation.
* @param {...*} [args] The arguments to invoke the function with.
* @returns {number} Returns the timer id.
* @example
@@ -6266,7 +6266,7 @@
* provided it determines the cache key for storing the result based on the
* arguments provided to the memoized function. By default, the first argument
* provided to the memoized function is used as the cache key. The `func` is
* executed with the `this` binding of the memoized function. The result cache
* invoked with the `this` binding of the memoized function. The result cache
* is exposed as the `cache` property on the memoized function.
*
* @static
@@ -6316,7 +6316,7 @@
/**
* Creates a function that negates the result of the predicate `func`. The
* `func` function is executed with the `this` binding and arguments of the
* `func` predicate is invoked with the `this` binding and arguments of the
* created function.
*
* @static
@@ -6343,8 +6343,8 @@
}
/**
* Creates a function that is restricted to execute `func` once. Repeat calls
* to the function return the value of the first call. The `func` is executed
* Creates a function that is restricted to invoking `func` once. Repeat calls
* to the function return the value of the first call. The `func` is invoked
* with the `this` binding of the created function.
*
* @static
@@ -6358,17 +6358,17 @@
* var initialize = _.once(createApplication);
* initialize();
* initialize();
* // `initialize` executes `createApplication` once
* // `initialize` invokes `createApplication` once
*/
var once = partial(before, 2);
/**
* Creates a function that invokes `func` with any additional `partial` arguments
* prepended to those provided to the new function. This method is similar to
* `_.bind` except it does **not** alter the `this` binding.
* Creates a function that invokes `func` with `partial` arguments prepended
* to those provided to the new function. This method is similar to `_.bind`
* except it does **not** alter the `this` binding.
*
* **Note:** This method does not set the `length` property of partially applied
* functions.
* **Note:** This method does not set the `length` property of partially
* applied functions.
*
* @static
* @memberOf _
@@ -6429,15 +6429,15 @@
}
/**
* Creates a function that only calls the `func` function at most once per
* every `wait` milliseconds. The created function comes with a `cancel` method
* to cancel delayed calls. Provide an options object to indicate that `func`
* should be invoked on the leading and/or trailing edge of the `wait` timeout.
* Creates a function that only invokes `func` at most once per every `wait`
* milliseconds. The created function comes with a `cancel` method to cancel
* delayed invokes. Provide an options object to indicate that `func` should
* be invoked on the leading and/or trailing edge of the `wait` timeout.
* Subsequent calls to the throttled function return the result of the last
* `func` call.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is called on
* the trailing edge of the timeout only if the the throttled function is
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
@@ -6447,11 +6447,11 @@
* @memberOf _
* @category Function
* @param {Function} func The function to throttle.
* @param {number} wait The number of milliseconds to throttle executions to.
* @param {number} wait The number of milliseconds to throttle invocations to.
* @param {Object} [options] The options object.
* @param {boolean} [options.leading=true] Specify execution on the leading
* @param {boolean} [options.leading=true] Specify invoking on the leading
* edge of the timeout.
* @param {boolean} [options.trailing=true] Specify execution on the trailing
* @param {boolean} [options.trailing=true] Specify invoking on the trailing
* edge of the timeout.
* @returns {Function} Returns the new throttled function.
* @example
@@ -6459,7 +6459,7 @@
* // avoid excessively updating the position while scrolling
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
*
* // execute `renewToken` when the click event is fired, but not more than once every 5 minutes
* // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false })
* jQuery('.interactive').on('click', throttled);
*
@@ -6487,9 +6487,9 @@
/**
* Creates a function that provides `value` to the wrapper function as its
* first argument. Additional arguments provided to the function are appended
* to those provided to the wrapper function. The wrapper is executed with
* the `this` binding of the created function.
* first argument. Any additional arguments provided to the function are
* appended to those provided to the wrapper function. The wrapper is invoked
* with the `this` binding of the created function.
*
* @static
* @memberOf _
@@ -6515,7 +6515,7 @@
/**
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources overwrite property assignments of previous sources.
* If `customizer` is provided it is executed to produce the assigned values.
* If `customizer` is provided it is invoked to produce the assigned values.
* The `customizer` is bound to `thisArg` and invoked with five arguments;
* (objectValue, sourceValue, key, object, source).
*
@@ -6545,7 +6545,7 @@
/**
* Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
* otherwise they are assigned by reference. If `customizer` is provided it is
* executed to produce the cloned values. If `customizer` returns `undefined`
* invoked to produce the cloned values. If `customizer` returns `undefined`
* cloning is handled by the method instead. The `customizer` is bound to
* `thisArg` and invoked with two argument; (value, index|key).
*
@@ -6607,7 +6607,7 @@
}
/**
* Creates a deep clone of `value`. If `customizer` is provided it is executed
* Creates a deep clone of `value`. If `customizer` is provided it is invoked
* to produce the cloned values. If `customizer` returns `undefined` cloning
* is handled by the method instead. The `customizer` is bound to `thisArg`
* and invoked with two argument; (value, index|key).
@@ -6732,7 +6732,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to search.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -6778,7 +6778,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to search.
* @param {Function|Object|string} [predicate=identity] The function called
* @param {Function|Object|string} [predicate=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -6810,7 +6810,7 @@
}
/**
* Iterates over own and inherited enumerable properties of an object executing
* Iterates over own and inherited enumerable properties of an object invoking
* `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
* with three arguments; (value, key, object). Iterator functions may exit
* iteration early by explicitly returning `false`.
@@ -6819,7 +6819,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Object} Returns `object`.
* @example
@@ -6851,7 +6851,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Object} Returns `object`.
* @example
@@ -6874,7 +6874,7 @@
}
/**
* Iterates over own enumerable properties of an object executing `iteratee`
* Iterates over own enumerable properties of an object invoking `iteratee`
* for each property. The `iteratee` is bound to `thisArg` and invoked with
* three arguments; (value, key, object). Iterator functions may exit iteration
* early by explicitly returning `false`.
@@ -6883,7 +6883,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Object} Returns `object`.
* @example
@@ -6908,7 +6908,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Object} Returns `object`.
* @example
@@ -7172,7 +7172,7 @@
/**
* Performs a deep comparison between two values to determine if they are
* equivalent. If `customizer` is provided it is executed to compare values.
* equivalent. If `customizer` is provided it is invoked to compare values.
* If `customizer` returns `undefined` comparisons are handled by the method
* instead. The `customizer` is bound to `thisArg` and invoked with three
* arguments; (value, other, key).
@@ -7653,7 +7653,7 @@
* @memberOf _
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function|Object|string} [iteratee=identity] The function called
* @param {Function|Object|string} [iteratee=identity] The function invoked
* per iteration. If a property name or object is provided it is used to
* create a "_.pluck" or "_.where" style callback respectively.
* @param {*} [thisArg] The `this` binding of `iteratee`.
@@ -7686,8 +7686,8 @@
* Recursively merges own enumerable properties of the source object(s), that
* don't resolve to `undefined` into the destination object. Subsequent sources
* overwrite property assignments of previous sources. If `customizer` is
* provided it is executed to produce the merged values of the destination
* and source properties. If `customizer` returns `undefined` merging is handled
* provided it is invoked to produce the merged values of the destination and
* source properties. If `customizer` returns `undefined` merging is handled
* by the method instead. The `customizer` is bound to `thisArg` and invoked
* with five arguments; (objectValue, sourceValue, key, object, source).
*
@@ -7738,7 +7738,7 @@
/**
* Creates a shallow clone of `object` excluding the specified properties.
* Property names may be specified as individual arguments or as arrays of
* property names. If a predicate is provided it is executed for each property
* property names. If a predicate is provided it is invoked for each property
* of `object` omitting the properties the predicate returns truthy for. The
* predicate is bound to `thisArg` and invoked with three arguments;
* (value, key, object).
@@ -7747,7 +7747,7 @@
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {Function|...(string|string[])} [predicate] The function called per
* @param {Function|...(string|string[])} [predicate] The function invoked per
* iteration or property names to omit, specified as individual property
* names or arrays of property names.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -7807,7 +7807,7 @@
/**
* Creates a shallow clone of `object` composed of the specified properties.
* Property names may be specified as individual arguments or as arrays of
* property names. If a predicate is provided it is executed for each property
* property names. If a predicate is provided it is invoked for each property
* of `object` picking the properties the predicate returns truthy for. The
* predicate is bound to `thisArg` and invoked with three arguments;
* (value, key, object).
@@ -7816,7 +7816,7 @@
* @memberOf _
* @category Object
* @param {Object} object The source object.
* @param {Function|...(string|string[])} [predicate] The function called per
* @param {Function|...(string|string[])} [predicate] The function invoked per
* iteration or property names to pick, specified as individual property
* names or arrays of property names.
* @param {*} [thisArg] The `this` binding of `predicate`.
@@ -7844,7 +7844,7 @@
/**
* An alternative to `_.reduce`; this method transforms `object` to a new
* `accumulator` object which is the result of running each of its own
* enumerable properties through `iteratee`, with each execution potentially
* enumerable properties through `iteratee`, with each invocation potentially
* mutating the `accumulator` object. The `iteratee` is bound to `thisArg`
* and invoked with four arguments; (accumulator, value, key, object). Iterator
* functions may exit iteration early by explicitly returning `false`.
@@ -7853,7 +7853,7 @@
* @memberOf _
* @category Object
* @param {Array|Object} object The object to iterate over.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [accumulator] The custom accumulator value.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {*} Returns the accumulated value.
@@ -8681,7 +8681,7 @@
/*--------------------------------------------------------------------------*/
/**
* Attempts to execute `func`, returning either the result or the caught
* Attempts to invoke `func`, returning either the result or the caught
* error object.
*
* @static
@@ -8984,7 +8984,7 @@
* @example
*
* _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now());
* // => logs the number of milliseconds it took for the deferred function to be called
* // => logs the number of milliseconds it took for the deferred function to be invoked
*/
var now = nativeNow || function() {
return new Date().getTime();
@@ -9223,15 +9223,15 @@
}
/**
* Executes the iteratee function `n` times, returning an array of the results
* of each execution. The `iteratee` is bound to `thisArg` and invoked with
* Invokes the iteratee function `n` times, returning an array of the results
* of each invocation. The `iteratee` is bound to `thisArg` and invoked with
* one argument; (index).
*
* @static
* @memberOf _
* @category Utility
* @param {number} n The number of times to execute `iteratee`.
* @param {Function} [iteratee=identity] The function called per iteration.
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} [iteratee=identity] The function invoked per iteration.
* @param {*} [thisArg] The `this` binding of `iteratee`.
* @returns {Array} Returns the array of results.
* @example
@@ -9240,10 +9240,10 @@
* // => [3, 6, 4]
*
* _.times(3, function(n) { mage.castSpell(n); });
* // => calls `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively
* // => invokes `mage.castSpell(n)` three times, passing `n` of `0`, `1`, and `2` respectively
*
* _.times(3, function(n) { this.cast(n); }, mage);
* // => also calls `mage.castSpell(n)` three times
* // => also invokes `mage.castSpell(n)` three times
*/
function times(n, iteratee, thisArg) {
n = nativeIsFinite(n = +n) && n > -1 ? n : 0;