Bump to v4.0.3.

This commit is contained in:
John-David Dalton
2016-01-29 23:55:57 -08:00
parent a9140d2c8f
commit 0152377457
247 changed files with 4002 additions and 1272 deletions

View File

@@ -1,4 +1,4 @@
# lodash.tosafeinteger v4.0.2
# lodash.tosafeinteger v4.0.3
The [lodash](https://lodash.com/) method `_.toSafeInteger` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var toSafeInteger = require('lodash.tosafeinteger');
```
See the [documentation](https://lodash.com/docs#toSafeInteger) or [package source](https://github.com/lodash/lodash/blob/4.0.2-npm-packages/lodash.tosafeinteger) for more details.
See the [documentation](https://lodash.com/docs#toSafeInteger) or [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash.tosafeinteger) for more details.

View File

@@ -1,5 +1,5 @@
/**
* lodash 4.0.2 (Custom Build) <https://lodash.com/>
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
@@ -44,7 +44,7 @@ var objectProto = Object.prototype;
var objectToString = objectProto.toString;
/**
* The base implementation of `_.clamp` which doesn't coerce arguments to numbers.
* The base implementation of `_.clamp` which doesn't coerce arguments.
*
* @private
* @param {number} number The number to clamp.
@@ -72,8 +72,7 @@ function baseClamp(number, lower, upper) {
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
@@ -156,8 +155,7 @@ function isObjectLike(value) {
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
@@ -171,10 +169,45 @@ 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 an integer.
*
* **Note:** This function is loosely based on
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
*
* @static
@@ -185,7 +218,7 @@ function isSymbol(value) {
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3);
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
@@ -194,20 +227,14 @@ function isSymbol(value) {
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3');
* _.toInteger('3.2');
* // => 3
*/
function toInteger(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;
}
var remainder = value % 1;
return value === value ? (remainder ? value - remainder : value) : 0;
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
/**
@@ -221,8 +248,8 @@ function toInteger(value) {
* @returns {number} Returns the number.
* @example
*
* _.toNumber(3);
* // => 3
* _.toNumber(3.2);
* // => 3.2
*
* _.toNumber(Number.MIN_VALUE);
* // => 5e-324
@@ -230,8 +257,8 @@ function toInteger(value) {
* _.toNumber(Infinity);
* // => Infinity
*
* _.toNumber('3');
* // => 3
* _.toNumber('3.2');
* // => 3.2
*/
function toNumber(value) {
if (typeof value == 'number') {
@@ -266,7 +293,7 @@ function toNumber(value) {
* @returns {number} Returns the converted integer.
* @example
*
* _.toSafeInteger(3);
* _.toSafeInteger(3.2);
* // => 3
*
* _.toSafeInteger(Number.MIN_VALUE);
@@ -275,7 +302,7 @@ function toNumber(value) {
* _.toSafeInteger(Infinity);
* // => 9007199254740991
*
* _.toSafeInteger('3');
* _.toSafeInteger('3.2');
* // => 3
*/
function toSafeInteger(value) {

View File

@@ -1,6 +1,6 @@
{
"name": "lodash.tosafeinteger",
"version": "4.0.2",
"version": "4.0.3",
"description": "The lodash method `_.toSafeInteger` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",