source: trip-planner-front/node_modules/core-js/internals/number-parse-int.js@ 1ad8e64

Last change on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 605 bytes
Line 
1var global = require('../internals/global');
2var toString = require('../internals/to-string');
3var trim = require('../internals/string-trim').trim;
4var whitespaces = require('../internals/whitespaces');
5
6var $parseInt = global.parseInt;
7var hex = /^[+-]?0[Xx]/;
8var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
9
10// `parseInt` method
11// https://tc39.es/ecma262/#sec-parseint-string-radix
12module.exports = FORCED ? function parseInt(string, radix) {
13 var S = trim(toString(string));
14 return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
15} : $parseInt;
Note: See TracBrowser for help on using the repository browser.