Bump to v4.7.0.

This commit is contained in:
John-David Dalton
2016-03-26 00:00:36 -07:00
parent a83b4ebd53
commit ce0b51888c
394 changed files with 1789 additions and 841 deletions

View File

@@ -1,5 +1,6 @@
import isFunction from './isFunction';
import isObject from './isObject';
import isSymbol from './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);