mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Rebuild dist.
This commit is contained in:
383
dist/lodash.underscore.js
vendored
383
dist/lodash.underscore.js
vendored
@@ -120,7 +120,7 @@
|
||||
* **Note:** Though the ">" character is escaped for symmetry, characters like
|
||||
* ">" and "/" don't require escaping in HTML and have no special meaning
|
||||
* unless they're part of a tag or unquoted attribute value.
|
||||
* See [Mathias' article](http://mathiasbynens.be/notes/ambiguous-ampersands)
|
||||
* See [Mathias Bynens's article](http://mathiasbynens.be/notes/ambiguous-ampersands)
|
||||
* (under "semi-related fun fact") for more details.
|
||||
*
|
||||
* Backticks are escaped because in Internet Explorer < 9, they can break out
|
||||
@@ -348,25 +348,25 @@
|
||||
*
|
||||
* The chainable wrapper functions are:
|
||||
* `after`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `callback`,
|
||||
* `chain`, `chunk`, `compact`, `compose`, `concat`, `constant`, `countBy`,
|
||||
* `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`,
|
||||
* `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`,
|
||||
* `flattenDeep`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
|
||||
* `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, `intersection`,
|
||||
* `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, `matches`, `memoize`,
|
||||
* `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, `pairs`, `partial`,
|
||||
* `partialRight`, `partition`, `pick`, `pluck`, `property`, `pull`, `pullAt`,
|
||||
* `push`, `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`,
|
||||
* `sort`, `sortBy`, `splice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`,
|
||||
* `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
|
||||
* `unzip`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`,
|
||||
* and `zipObject`
|
||||
* `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, `create`,
|
||||
* `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `drop`,
|
||||
* `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, `flattenDeep`,
|
||||
* `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`,
|
||||
* `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`,
|
||||
* `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`,
|
||||
* `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, `omit`, `once`,
|
||||
* `pairs`, `partial`, `partialRight`, `partition`, `pick`, `pluck`, `property`,
|
||||
* `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, `rest`, `reverse`,
|
||||
* `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, `takeRight`,
|
||||
* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `times`, `toArray`,
|
||||
* `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`,
|
||||
* `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject`
|
||||
*
|
||||
* The non-chainable wrapper functions are:
|
||||
* `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `contains`,
|
||||
* `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
|
||||
* `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
|
||||
* `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`,
|
||||
* `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
|
||||
* `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,
|
||||
* `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`,
|
||||
* `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, `isFunction`,
|
||||
* `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
|
||||
* `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`,
|
||||
@@ -449,18 +449,6 @@
|
||||
* @type boolean
|
||||
*/
|
||||
support.spliceObjects = (splice.call(object, 0, 1), !object[0]);
|
||||
|
||||
/**
|
||||
* Detect if the host objects are detectable (IE < 9).
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type boolean
|
||||
*/
|
||||
try {
|
||||
support.hostObject = !({ 'toString': 0 } + '');
|
||||
} catch(e) {
|
||||
support.hostObject = false;
|
||||
}
|
||||
}(0, 0));
|
||||
|
||||
/**
|
||||
@@ -515,7 +503,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) {
|
||||
@@ -536,7 +524,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`
|
||||
*/
|
||||
@@ -558,7 +546,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) {
|
||||
@@ -578,7 +566,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) {
|
||||
@@ -602,7 +590,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.
|
||||
@@ -627,7 +615,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.
|
||||
@@ -651,7 +639,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`.
|
||||
*/
|
||||
@@ -788,7 +776,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) {
|
||||
@@ -813,7 +801,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) {
|
||||
@@ -836,7 +824,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`
|
||||
*/
|
||||
@@ -856,7 +844,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) {
|
||||
@@ -877,7 +865,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.
|
||||
@@ -937,13 +925,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`.
|
||||
*/
|
||||
@@ -967,7 +955,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`.
|
||||
*/
|
||||
@@ -990,7 +978,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) {
|
||||
@@ -1003,7 +991,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) {
|
||||
@@ -1016,7 +1004,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) {
|
||||
@@ -1199,7 +1187,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) {
|
||||
@@ -1254,7 +1242,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.
|
||||
@@ -1276,7 +1264,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`.
|
||||
*/
|
||||
@@ -1297,7 +1285,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
|
||||
@@ -1335,7 +1323,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) {
|
||||
@@ -1611,7 +1599,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.
|
||||
@@ -1651,7 +1639,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) {
|
||||
@@ -1718,7 +1706,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) {
|
||||
@@ -1875,7 +1863,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`.
|
||||
@@ -2215,7 +2203,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).
|
||||
*
|
||||
@@ -2231,7 +2219,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`.
|
||||
@@ -2315,7 +2303,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).
|
||||
*
|
||||
@@ -2336,7 +2324,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`.
|
||||
@@ -2661,7 +2649,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`.
|
||||
@@ -2698,7 +2686,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`.
|
||||
@@ -2747,7 +2735,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`.
|
||||
@@ -2794,7 +2782,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`.
|
||||
@@ -2858,8 +2846,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`.
|
||||
*
|
||||
@@ -2872,7 +2860,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
|
||||
@@ -2907,7 +2895,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`.
|
||||
@@ -2950,7 +2938,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`.
|
||||
@@ -2977,9 +2965,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 _
|
||||
@@ -3018,7 +3006,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`.
|
||||
@@ -3050,7 +3038,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).
|
||||
*
|
||||
@@ -3065,7 +3053,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`.
|
||||
@@ -3128,7 +3116,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).
|
||||
*
|
||||
@@ -3143,7 +3131,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`.
|
||||
@@ -3220,7 +3208,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`.
|
||||
@@ -3277,7 +3265,7 @@
|
||||
/**
|
||||
* 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`
|
||||
* invocation is supplied 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).
|
||||
@@ -3287,7 +3275,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.
|
||||
@@ -3316,7 +3304,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.
|
||||
@@ -3346,7 +3334,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`.
|
||||
@@ -3484,7 +3472,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`.
|
||||
@@ -3538,7 +3526,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.
|
||||
@@ -3642,13 +3630,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
|
||||
@@ -3677,13 +3665,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
|
||||
@@ -3772,68 +3760,14 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that is the composition of the provided functions,
|
||||
* where each function consumes the return value of the function that follows.
|
||||
* For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
|
||||
* Each function is executed with the `this` binding of the composed function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {...Function} [funcs] Functions to compose.
|
||||
* @returns {Function} Returns the new composed function.
|
||||
* @example
|
||||
*
|
||||
* var realNameMap = {
|
||||
* 'pebbles': 'penelope'
|
||||
* };
|
||||
*
|
||||
* var format = function(name) {
|
||||
* name = realNameMap[name.toLowerCase()] || name;
|
||||
* return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase();
|
||||
* };
|
||||
*
|
||||
* var greet = function(formatted) {
|
||||
* return 'Hiya ' + formatted + '!';
|
||||
* };
|
||||
*
|
||||
* var welcome = _.compose(greet, format);
|
||||
* welcome('pebbles');
|
||||
* // => 'Hiya Penelope!'
|
||||
*/
|
||||
function compose() {
|
||||
var funcs = arguments,
|
||||
length = funcs.length,
|
||||
index = length - 1;
|
||||
|
||||
if (!length) {
|
||||
return function() {};
|
||||
}
|
||||
while (length--) {
|
||||
if (!isFunction(funcs[length])) {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
}
|
||||
return function() {
|
||||
length = index;
|
||||
var result = funcs[length].apply(this, arguments);
|
||||
|
||||
while (length--) {
|
||||
result = funcs[length].call(this, result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -3846,11 +3780,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
|
||||
@@ -3858,13 +3792,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
|
||||
@@ -4002,8 +3936,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 _
|
||||
@@ -4025,14 +3959,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
|
||||
@@ -4048,12 +3982,57 @@
|
||||
return setTimeout(function() { func.apply(undefined, args); }, wait);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is like `_.flow` except that it creates a function that
|
||||
* invokes the provided functions from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias backflow, compose
|
||||
* @category Function
|
||||
* @param {...Function} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function add(x, y) {
|
||||
* return x + y;
|
||||
* }
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flowRight(square, add);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
function flowRight() {
|
||||
var funcs = arguments,
|
||||
fromIndex = funcs.length - 1;
|
||||
|
||||
if (fromIndex < 0) {
|
||||
return function() {};
|
||||
}
|
||||
if (!arrayEvery(funcs, isFunction)) {
|
||||
throw new TypeError(FUNC_ERROR_TEXT);
|
||||
}
|
||||
return function() {
|
||||
var index = fromIndex,
|
||||
result = funcs[index].apply(this, arguments);
|
||||
|
||||
while (index--) {
|
||||
result = funcs[index].call(this, result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that memoizes the result of `func`. If `resolver` is
|
||||
* 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
|
||||
@@ -4100,8 +4079,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
|
||||
@@ -4115,17 +4094,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 _
|
||||
@@ -4148,15 +4127,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)
|
||||
@@ -4166,11 +4145,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
|
||||
@@ -4178,7 +4157,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);
|
||||
*
|
||||
@@ -4207,9 +4186,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 _
|
||||
@@ -4235,7 +4214,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).
|
||||
*
|
||||
@@ -4284,7 +4263,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).
|
||||
*
|
||||
@@ -4388,7 +4367,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.functions(_);
|
||||
* // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...]
|
||||
* // => ['all', 'any', 'bind', ...]
|
||||
*/
|
||||
function functions(object) {
|
||||
return baseFunctions(object, keysIn(object));
|
||||
@@ -4468,7 +4447,8 @@
|
||||
* // => false
|
||||
*/
|
||||
function isArguments(value) {
|
||||
return (value && typeof value == 'object' && typeof value.length == 'number' &&
|
||||
var length = (value && typeof value == 'object') ? value.length : undefined;
|
||||
return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER &&
|
||||
toString.call(value) == argsClass) || false;
|
||||
}
|
||||
// fallback for environments without a `[[Class]]` for `arguments` objects
|
||||
@@ -4603,7 +4583,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).
|
||||
@@ -4801,12 +4781,7 @@
|
||||
if (isFunction(value)) {
|
||||
return reNative.test(fnToString.call(value));
|
||||
}
|
||||
if (value && typeof value == 'object') {
|
||||
return !('constructor' in value) && isHostObject(value)
|
||||
? reNative.test(value)
|
||||
: reHostCtor.test(toString.call(value));
|
||||
}
|
||||
return false;
|
||||
return (value && typeof value == 'object' && reHostCtor.test(value)) || false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4976,7 +4951,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).
|
||||
@@ -4985,7 +4960,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`.
|
||||
@@ -5040,7 +5015,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).
|
||||
@@ -5049,7 +5024,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`.
|
||||
@@ -5097,7 +5072,7 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Converts the characters "&", "<", ">", '"', and "'" in `string` to
|
||||
* Converts the characters "&", "<", ">", '"', "'", and '`', in `string` to
|
||||
* their corresponding HTML entities.
|
||||
*
|
||||
* **Note:** No other characters are escaped. To escape additional characters
|
||||
@@ -5297,7 +5272,7 @@
|
||||
|
||||
/**
|
||||
* The inverse of `_.escape`; this method converts the HTML entities
|
||||
* `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their
|
||||
* corresponding characters.
|
||||
*
|
||||
* **Note:** No other HTML entities are unescaped. To unescape additional HTML
|
||||
@@ -5323,7 +5298,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
|
||||
@@ -5521,7 +5496,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();
|
||||
@@ -5700,15 +5675,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
|
||||
@@ -5717,10 +5692,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;
|
||||
@@ -5774,7 +5749,6 @@
|
||||
lodash.bindAll = bindAll;
|
||||
lodash.chain = chain;
|
||||
lodash.compact = compact;
|
||||
lodash.compose = compose;
|
||||
lodash.constant = constant;
|
||||
lodash.countBy = countBy;
|
||||
lodash.debounce = debounce;
|
||||
@@ -5826,6 +5800,7 @@
|
||||
|
||||
// add aliases
|
||||
lodash.collect = map;
|
||||
lodash.compose = flowRight;
|
||||
lodash.each = forEach;
|
||||
lodash.extend = assign;
|
||||
lodash.methods = functions;
|
||||
|
||||
Reference in New Issue
Block a user