Fix typo in find.

This commit is contained in:
John-David Dalton
2017-04-16 16:06:30 -05:00
parent 58e484f389
commit a023f92049

View File

@@ -26,10 +26,12 @@ import keys from './keys'
* // => object for 'barney'
*/
function find(collection, predicate, fromIndex) {
let iteratee
const iterable = Object(collection)
if (!isArrayLike(collection)) {
collection = keys(collection)
predicate = (key) => iteratee(iterable[key], key, iterable)
iteratee = (key) => predicate(iterable[key], key, iterable)
}
const index = findIndex(collection, predicate, fromIndex)
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined