Bump to v4.7.0.

This commit is contained in:
John-David Dalton
2016-03-25 23:47:49 -07:00
parent 501d6b1d41
commit 18d0f1d873
419 changed files with 4042 additions and 2066 deletions

View File

@@ -1,5 +1,6 @@
var isFunction = require('./isFunction'),
isObject = require('./isObject');
isObject = require('./isObject'),
isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
@@ -24,6 +25,7 @@ var freeParseInt = parseInt;
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to process.
* @returns {number} Returns the number.
@@ -42,12 +44,18 @@ var freeParseInt = parseInt;
* // => 3
*/
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string') {
return value === 0 ? value : +value;
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value);