PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/node_modules/babel-polyfill/node_modules/core-js/library/modules/_parse-int.js

https://bitbucket.org/worklabschd/bingle_customer2
JavaScript | 9 lines | 8 code | 1 blank | 0 comment | 2 complexity | ee9408d787bbe58415bd57a4d3d6d23b MD5 | raw file
1var $parseInt = require('./_global').parseInt;
2var $trim = require('./_string-trim').trim;
3var ws = require('./_string-ws');
4var hex = /^[-+]?0[xX]/;
5
6module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
7  var string = $trim(String(str), 3);
8  return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
9} : $parseInt;