Bump to v4.17.21

This commit is contained in:
Benjamin Tan
2021-02-20 23:33:13 +08:00
parent 42e2585e5f
commit 11eb817cdf
11 changed files with 71 additions and 18 deletions

View File

@@ -1,12 +1,10 @@
import baseTrim from './_baseTrim.js';
import isObject from './isObject.js';
import isSymbol from './isSymbol.js';
/** Used as references for various `Number` constants. */
var NAN = 0 / 0;
/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;
/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
@@ -56,7 +54,7 @@ function toNumber(value) {
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)