/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

  1. var $parseInt = require('./_global').parseInt;
  2. var $trim = require('./_string-trim').trim;
  3. var ws = require('./_string-ws');
  4. var hex = /^[-+]?0[xX]/;
  5. module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
  6. var string = $trim(String(str), 3);
  7. return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  8. } : $parseInt;