Bump to v3.3.5.

This commit is contained in:
John-David Dalton
2016-04-20 21:51:03 -07:00
parent 9a9ba47586
commit fbdd63d3ad
7 changed files with 63 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
# lodash.inrange v3.3.4
# lodash.inrange v3.3.5
The [lodash](https://lodash.com/) method `_.inRange` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var inRange = require('lodash.inrange');
```
See the [documentation](https://lodash.com/docs#inRange) or [package source](https://github.com/lodash/lodash/blob/3.3.4-npm-packages/lodash.inrange) for more details.
See the [documentation](https://lodash.com/docs#inRange) or [package source](https://github.com/lodash/lodash/blob/3.3.5-npm-packages/lodash.inrange) for more details.

View File

@@ -8,7 +8,9 @@
*/
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
var INFINITY = 1 / 0,
MAX_INTEGER = 1.7976931348623157e+308,
NAN = 0 / 0;
/** `Object#toString` result references. */
var funcTag = '[object Function]',
@@ -162,6 +164,41 @@ function isSymbol(value) {
(isObjectLike(value) && objectToString.call(value) == symbolTag);
}
/**
* Converts `value` to a finite number.
*
* @static
* @memberOf _
* @since 4.12.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted number.
* @example
*
* _.toFinite(3.2);
* // => 3.2
*
* _.toFinite(Number.MIN_VALUE);
* // => 5e-324
*
* _.toFinite(Infinity);
* // => 1.7976931348623157e+308
*
* _.toFinite('3.2');
* // => 3.2
*/
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
/**
* Converts `value` to a number.
*
@@ -245,12 +282,12 @@ function toNumber(value) {
* // => true
*/
function inRange(number, start, end) {
start = toNumber(start) || 0;
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toNumber(end) || 0;
end = toFinite(end);
}
number = toNumber(number);
return baseInRange(number, start, end);

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.inrange",
"version": "3.3.4",
"version": "3.3.5",
"description": "The lodash method `_.inRange` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",