.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / number-parse-int.js
1 var global = require('../internals/global');
2 var trim = require('../internals/string-trim').trim;
3 var whitespaces = require('../internals/whitespaces');
4
5 var $parseInt = global.parseInt;
6 var hex = /^[+-]?0[Xx]/;
7 var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
8
9 // `parseInt` method
10 // https://tc39.es/ecma262/#sec-parseint-string-radix
11 module.exports = FORCED ? function parseInt(string, radix) {
12   var S = trim(String(string));
13   return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
14 } : $parseInt;