node_modules/lodash/toNumber.js in trusty-cms-4.3 vs node_modules/lodash/toNumber.js in trusty-cms-4.3.1
- old
+ new
@@ -1,14 +1,12 @@
-var isObject = require('./isObject'),
+var baseTrim = require('./_baseTrim'),
+ isObject = require('./isObject'),
isSymbol = require('./isSymbol');
/** 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;
/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;
@@ -54,10 +52,10 @@
value = isObject(other) ? (other + '') : other;
}
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)
: (reIsBadHex.test(value) ? NAN : +value);
}