diff options
author | Rich Trott <rtrott@gmail.com> | 2016-07-07 15:44:32 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-07-11 13:47:20 -0700 |
commit | e8a7003e940928e2d1684c12881dd2a39af2d7cc (patch) | |
tree | 92264eb4c317b287366e7774f6d4e15000856e06 /tools/eslint/node_modules/lodash/findLast.js | |
parent | fcae5e2d9187b4a9c16cbce843c10e2087990946 (diff) | |
download | node-new-e8a7003e940928e2d1684c12881dd2a39af2d7cc.tar.gz |
tools: update ESLint, fix unused vars bug
Update ESLint to 3.0.0. This includes an enhancement to `no-unused-vars`
such that it finds a few instances in our code base that it did not find
previously (fixed in previous commits readying this for landing).
PR-URL: https://github.com/nodejs/node/pull/7601
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'tools/eslint/node_modules/lodash/findLast.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/findLast.js | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tools/eslint/node_modules/lodash/findLast.js b/tools/eslint/node_modules/lodash/findLast.js index d222a5588f..f8dd4e1d74 100644 --- a/tools/eslint/node_modules/lodash/findLast.js +++ b/tools/eslint/node_modules/lodash/findLast.js @@ -1,8 +1,5 @@ -var baseEachRight = require('./_baseEachRight'), - baseFind = require('./_baseFind'), - baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); +var createFind = require('./_createFind'), + findLastIndex = require('./findLastIndex'); /** * This method is like `_.find` except that it iterates over elements of @@ -15,6 +12,7 @@ var baseEachRight = require('./_baseEachRight'), * @param {Array|Object} collection The collection to search. * @param {Array|Function|Object|string} [predicate=_.identity] * The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * @@ -23,13 +21,6 @@ var baseEachRight = require('./_baseEachRight'), * }); * // => 3 */ -function findLast(collection, predicate) { - predicate = baseIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, true); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEachRight); -} +var findLast = createFind(findLastIndex); module.exports = findLast; |