mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Bump to v4.13.1.
This commit is contained in:
41
main.js
41
main.js
@@ -13,7 +13,7 @@
|
||||
var undefined;
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.13.0';
|
||||
var VERSION = '4.13.1';
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
@@ -4550,6 +4550,31 @@
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a `_.find` or `_.findLast` function.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} findIndexFunc The function to find the collection index.
|
||||
* @returns {Function} Returns the new find function.
|
||||
*/
|
||||
function createFind(findIndexFunc) {
|
||||
return function(collection, predicate, fromIndex) {
|
||||
var iterable = Object(collection);
|
||||
predicate = getIteratee(predicate, 3);
|
||||
if (!isArrayLike(collection)) {
|
||||
var props = keys(collection);
|
||||
}
|
||||
var index = findIndexFunc(props || collection, function(value, key) {
|
||||
if (props) {
|
||||
key = value;
|
||||
value = iterable[key];
|
||||
}
|
||||
return predicate(value, key, iterable);
|
||||
}, fromIndex);
|
||||
return index > -1 ? collection[props ? props[index] : index] : undefined;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a `_.flow` or `_.flowRight` function.
|
||||
*
|
||||
@@ -5795,7 +5820,7 @@
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `func` is maskable, else `false`.
|
||||
*/
|
||||
var isMaskable = !coreJsData ? stubFalse : isFunction;
|
||||
var isMaskable = coreJsData ? isFunction : stubFalse;
|
||||
|
||||
/**
|
||||
* Checks if `value` is likely a prototype object.
|
||||
@@ -8473,11 +8498,7 @@
|
||||
* _.find(users, 'active');
|
||||
* // => object for 'barney'
|
||||
*/
|
||||
function find(collection, predicate, fromIndex) {
|
||||
collection = isArrayLike(collection) ? collection : values(collection);
|
||||
var index = findIndex(collection, predicate, fromIndex);
|
||||
return index > -1 ? collection[index] : undefined;
|
||||
}
|
||||
var find = createFind(findIndex);
|
||||
|
||||
/**
|
||||
* This method is like `_.find` except that it iterates over elements of
|
||||
@@ -8499,11 +8520,7 @@
|
||||
* });
|
||||
* // => 3
|
||||
*/
|
||||
function findLast(collection, predicate, fromIndex) {
|
||||
collection = isArrayLike(collection) ? collection : values(collection);
|
||||
var index = findLastIndex(collection, predicate, fromIndex);
|
||||
return index > -1 ? collection[index] : undefined;
|
||||
}
|
||||
var findLast = createFind(findLastIndex);
|
||||
|
||||
/**
|
||||
* Creates a flattened array of values by running each element in `collection`
|
||||
|
||||
Reference in New Issue
Block a user