From d7aa8fa088f3b8a31c7d85c6d71824c8c60e7c17 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 15 Feb 2016 14:45:53 -0800 Subject: tools: update ESLint to version 2.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update ESLint to 2.1.0. ESLint has a number of potentially-useful new features but this change attempts to be minimal in its changes. However, some things could not be avoided reasonably. ESLint 2.1.0 found a few lint issues that ESLing 1.x missed with template strings that did not take advantage of any features of template strings, and `let` declarations where `const` sufficed. Additionally, ESLint 2.1.0 removes some granularity around enabling ES6 features. Some features (e.g., spread operator) that had been turned off in our configuration for ESLint 1.x are now permitted. PR-URL: https://github.com/nodejs/node/pull/5214 Reviewed-By: Michaël Zasso Reviewed-By: jbergstroem - Johan Bergström Reviewed-By: James M Snell Reviewed-By: Roman Reiss Reviewed-By: Myles Borins --- tools/eslint/node_modules/lodash/inRange.js | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tools/eslint/node_modules/lodash/inRange.js (limited to 'tools/eslint/node_modules/lodash/inRange.js') diff --git a/tools/eslint/node_modules/lodash/inRange.js b/tools/eslint/node_modules/lodash/inRange.js new file mode 100644 index 0000000000..69c61101cd --- /dev/null +++ b/tools/eslint/node_modules/lodash/inRange.js @@ -0,0 +1,52 @@ +var baseInRange = require('./_baseInRange'), + toNumber = require('./toNumber'); + +/** + * Checks if `n` is between `start` and up to but not including, `end`. If + * `end` is not specified it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ +function inRange(number, start, end) { + start = toNumber(start) || 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + number = toNumber(number); + return baseInRange(number, start, end); +} + +module.exports = inRange; -- cgit v1.2.1