Apply arrow function transform.

This commit is contained in:
John-David Dalton
2017-01-06 15:41:39 -08:00
parent d461c87979
commit 7167d7e09f
108 changed files with 172 additions and 271 deletions

View File

@@ -10,12 +10,12 @@ import keys from './keys.js';
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
return (collection, predicate, fromIndex) => {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
predicate = key => iteratee(iterable[key], key, iterable);
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;