mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Bump to v4.13.1.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# lodash-es v4.13.0
|
||||
# lodash-es v4.13.1
|
||||
|
||||
The [Lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
|
||||
|
||||
@@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
||||
$ lodash modularize exports=es -o ./
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.13.0-es) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.13.1-es) for more details.
|
||||
|
||||
30
_createFind.js
Normal file
30
_createFind.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import baseIteratee from './_baseIteratee.js';
|
||||
import isArrayLike from './isArrayLike.js';
|
||||
import keys from './keys.js';
|
||||
|
||||
/**
|
||||
* 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 = baseIteratee(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;
|
||||
};
|
||||
}
|
||||
|
||||
export default createFind;
|
||||
@@ -9,6 +9,6 @@ import stubFalse from './stubFalse.js';
|
||||
* @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;
|
||||
|
||||
export default isMaskable;
|
||||
|
||||
9
find.js
9
find.js
@@ -1,6 +1,5 @@
|
||||
import createFind from './_createFind.js';
|
||||
import findIndex from './findIndex.js';
|
||||
import isArrayLike from './isArrayLike.js';
|
||||
import values from './values.js';
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection`, returning the first element
|
||||
@@ -39,10 +38,6 @@ import values from './values.js';
|
||||
* _.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);
|
||||
|
||||
export default find;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import createFind from './_createFind.js';
|
||||
import findLastIndex from './findLastIndex.js';
|
||||
import isArrayLike from './isArrayLike.js';
|
||||
import values from './values.js';
|
||||
|
||||
/**
|
||||
* This method is like `_.find` except that it iterates over elements of
|
||||
@@ -22,10 +21,6 @@ import values from './values.js';
|
||||
* });
|
||||
* // => 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);
|
||||
|
||||
export default findLast;
|
||||
|
||||
@@ -44,7 +44,7 @@ import toInteger from './toInteger.js';
|
||||
import lodash from './wrapperLodash.js';
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.13.0';
|
||||
var VERSION = '4.13.1';
|
||||
|
||||
/** Used to compose bitmasks for wrapper metadata. */
|
||||
var BIND_KEY_FLAG = 2;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash-es",
|
||||
"version": "4.13.0",
|
||||
"version": "4.13.1",
|
||||
"description": "Lodash exported as ES modules.",
|
||||
"keywords": "es6, modules, stdlib, util",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
|
||||
Reference in New Issue
Block a user