mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Bump to v4.13.1.
This commit is contained in:
11
find.js
11
find.js
@@ -1,6 +1,5 @@
|
||||
var findIndex = require('./findIndex'),
|
||||
isArrayLike = require('./isArrayLike'),
|
||||
values = require('./values');
|
||||
var createFind = require('./_createFind'),
|
||||
findIndex = require('./findIndex');
|
||||
|
||||
/**
|
||||
* Iterates over elements of `collection`, returning the first element
|
||||
@@ -39,10 +38,6 @@ var findIndex = require('./findIndex'),
|
||||
* _.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);
|
||||
|
||||
module.exports = find;
|
||||
|
||||
Reference in New Issue
Block a user