Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

number-parse-int.js 962B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var fails = require('../internals/fails');
  4. var uncurryThis = require('../internals/function-uncurry-this');
  5. var toString = require('../internals/to-string');
  6. var trim = require('../internals/string-trim').trim;
  7. var whitespaces = require('../internals/whitespaces');
  8. var $parseInt = globalThis.parseInt;
  9. var Symbol = globalThis.Symbol;
  10. var ITERATOR = Symbol && Symbol.iterator;
  11. var hex = /^[+-]?0x/i;
  12. var exec = uncurryThis(hex.exec);
  13. var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
  14. // MS Edge 18- broken with boxed symbols
  15. || (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));
  16. // `parseInt` method
  17. // https://tc39.es/ecma262/#sec-parseint-string-radix
  18. module.exports = FORCED ? function parseInt(string, radix) {
  19. var S = trim(toString(string));
  20. return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
  21. } : $parseInt;