mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Compare commits
1 Commits
3.1.6-npm-
...
3.1.7-npm-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
005ee66119 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash v3.1.6
|
# lodash v3.1.7
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.
|
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.random v3.1.6
|
# lodash.random v3.1.7
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.random` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.random` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var random = require('lodash.random');
|
var random = require('lodash.random');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#random) or [package source](https://github.com/lodash/lodash/blob/3.1.6-npm-packages/lodash.random) for more details.
|
See the [documentation](https://lodash.com/docs#random) or [package source](https://github.com/lodash/lodash/blob/3.1.7-npm-packages/lodash.random) for more details.
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** Used as references for various `Number` constants. */
|
/** Used as references for various `Number` constants. */
|
||||||
var MAX_SAFE_INTEGER = 9007199254740991,
|
var INFINITY = 1 / 0,
|
||||||
|
MAX_SAFE_INTEGER = 9007199254740991,
|
||||||
|
MAX_INTEGER = 1.7976931348623157e+308,
|
||||||
NAN = 0 / 0;
|
NAN = 0 / 0;
|
||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
@@ -330,6 +332,41 @@ function isSymbol(value) {
|
|||||||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
(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.
|
* Converts `value` to a number.
|
||||||
*
|
*
|
||||||
@@ -424,12 +461,12 @@ function random(lower, upper, floating) {
|
|||||||
upper = 1;
|
upper = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lower = toNumber(lower) || 0;
|
lower = toFinite(lower);
|
||||||
if (upper === undefined) {
|
if (upper === undefined) {
|
||||||
upper = lower;
|
upper = lower;
|
||||||
lower = 0;
|
lower = 0;
|
||||||
} else {
|
} else {
|
||||||
upper = toNumber(upper) || 0;
|
upper = toFinite(upper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lower > upper) {
|
if (lower > upper) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.random",
|
"name": "lodash.random",
|
||||||
"version": "3.1.6",
|
"version": "3.1.7",
|
||||||
"description": "The lodash method `_.random` exported as a module.",
|
"description": "The lodash method `_.random` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.range v3.1.6
|
# lodash.range v3.1.7
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.range` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.range` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var range = require('lodash.range');
|
var range = require('lodash.range');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#range) or [package source](https://github.com/lodash/lodash/blob/3.1.6-npm-packages/lodash.range) for more details.
|
See the [documentation](https://lodash.com/docs#range) or [package source](https://github.com/lodash/lodash/blob/3.1.7-npm-packages/lodash.range) for more details.
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** Used as references for various `Number` constants. */
|
/** Used as references for various `Number` constants. */
|
||||||
var MAX_SAFE_INTEGER = 9007199254740991,
|
var INFINITY = 1 / 0,
|
||||||
|
MAX_SAFE_INTEGER = 9007199254740991,
|
||||||
|
MAX_INTEGER = 1.7976931348623157e+308,
|
||||||
NAN = 0 / 0;
|
NAN = 0 / 0;
|
||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
@@ -97,15 +99,14 @@ function createRange(fromRight) {
|
|||||||
end = step = undefined;
|
end = step = undefined;
|
||||||
}
|
}
|
||||||
// Ensure the sign of `-0` is preserved.
|
// Ensure the sign of `-0` is preserved.
|
||||||
start = toNumber(start);
|
start = toFinite(start);
|
||||||
start = start === start ? start : 0;
|
|
||||||
if (end === undefined) {
|
if (end === undefined) {
|
||||||
end = start;
|
end = start;
|
||||||
start = 0;
|
start = 0;
|
||||||
} else {
|
} else {
|
||||||
end = toNumber(end) || 0;
|
end = toFinite(end);
|
||||||
}
|
}
|
||||||
step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0);
|
step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
|
||||||
return baseRange(start, end, step, fromRight);
|
return baseRange(start, end, step, fromRight);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -364,6 +365,41 @@ function isSymbol(value) {
|
|||||||
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
(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.
|
* Converts `value` to a number.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.range",
|
"name": "lodash.range",
|
||||||
"version": "3.1.6",
|
"version": "3.1.7",
|
||||||
"description": "The lodash method `_.range` exported as a module.",
|
"description": "The lodash method `_.range` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
|||||||
Reference in New Issue
Block a user