mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
lint files (#4416)
* lint files * added back arrow-paren and removed duplicate
This commit is contained in:
committed by
John-David Dalton
parent
5b4dc54465
commit
15e1557b2a
@@ -17,16 +17,16 @@ import isArrayLike from './isArrayLike.js'
|
||||
* findLast([1, 2, 3, 4], n => n % 2 == 1)
|
||||
* // => 3
|
||||
*/
|
||||
function findLast (collection, predicate, fromIndex) {
|
||||
function findLast(collection, predicate, fromIndex) {
|
||||
let iteratee
|
||||
const iterable = Object(collection)
|
||||
if (!isArrayLike(collection)) {
|
||||
collection = Object.keys(collection)
|
||||
iteratee = predicate
|
||||
predicate = key => iteratee(iterable[key], key, iterable)
|
||||
predicate = (key) => iteratee(iterable[key], key, iterable)
|
||||
}
|
||||
const index = findLastIndex(collection, predicate, fromIndex)
|
||||
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
||||
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined
|
||||
}
|
||||
|
||||
export default findLast
|
||||
|
||||
Reference in New Issue
Block a user