parse-int-x
Version:
Parses a string argument and returns an integer of the specified radix.
15 lines • 10.6 kB
JavaScript
/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2017",
"date": "2019-08-28T16:53:59.078Z",
"describe": "",
"description": "Parses a string argument and returns an integer of the specified radix.",
"file": "parse-int-x.min.js",
"hash": "5aba5687fccdef0a8806",
"license": "MIT",
"version": "3.2.2"
}
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.parseIntX=t():e.parseIntX=t()}(function(){"use strict";var e,t={}.constructor,n=t.prototype,r=t.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return r?r(n,"$$globalThis$$",{get:i,configurable:!0}):n.__defineGetter__("$$globalThis$$",i),e="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete n.$$globalThis$$,e}catch(e){return o()}}(),function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(2)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";(function(t){var r=t.Symbol,o=n(4);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";n.r(t);for(var r=n(0),o=n.n(r),i="Cannot convert a Symbol value to a string",s=i.constructor,c=function(e){if(o()(e))throw new TypeError(i);return s(e)},u=function(e){return null==e},f=function(e){if(u(e))throw new TypeError("Cannot call method on ".concat(e));return e},p=function(e){return c(f(e))},a=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],l="",y=a.length,d=0;d<y;d+=1)a[d].es2016&&a[d].string,a[d].es2018&&(l+=a[d].string);var b=l;function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var h=function(e){return"object"===g(e)?null===e:"function"!=typeof e},m=n(1),v=n.n(m),S={}.constructor("a"),j="a"===S[0]&&0 in S,w=function(){}.bind,O="function"==typeof w&&function(){var e=null,t=null,n=null,r=[];try{var o=w.apply(function(r,o){return n=this,e=r,t=o,arguments},[r,1]),i=o(2);return 1===o.length&&2===i.length&&1===e&&2===t&&n===r}catch(e){return!1}}()&&function(){var e=null,t=null,n=null,r=[1,2,3],o=function(o,i){return e=o,t=i,n=this,r};try{var i=w.apply(o,[null]),s=new i(1,2);return i.length===o.length&&s===r&&1===e&&2===t&&n!==r}catch(e){return!1}}(),$="".split,x=Math.max,T=h.bind,P=h.call,E=O?T.call(P,$):function(e,t){return $.call(e,t)},_=function(e){return v()(e)?E(e,""):e},F=function(e,t){var n=arguments.length>2?arguments[2]:[];if("string"!=typeof e&&h(e))return n;for(var r=j?e:_(e),o=r.length,i=x(0,t)||0;i<o;i+=1)n[n.length]=e[i];return n};function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,c=e[Symbol.iterator]();!(r=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var k=F.bind,I=F.call,N={},A=N.constructor,C=N.toString,X=function(e,t){return e>=t?e:t},q=function(e){if("function"!=typeof e&&"[object Function]"!==C.apply(e))throw new TypeError("bind called on incompatible "+e)},D=[function(e){return function(){return e.apply(this,F(arguments))}},function(e,t){return function(n){return e.apply(this,F(arguments,t,[n]))}},function(e,t){return function(n,r){return e.apply(this,F(arguments,t,[n,r]))}},function(e,t){return function(n,r,o){return e.apply(this,F(arguments,t,[n,r,o]))}},function(e,t){return function(n,r,o,i){return e.apply(this,F(arguments,t,[n,r,o,i]))}},function(e,t){return function(n,r,o,i,s){return e.apply(this,F(arguments,t,[n,r,o,i,s]))}},function(e,t){return function(n,r,o,i,s,c){return e.apply(this,F(arguments,t,[n,r,o,i,s,c]))}},function(e,t){return function(n,r,o,i,s,c,u){return e.apply(this,F(arguments,t,[n,r,o,i,s,c,u]))}},function(e,t){return function(n,r,o,i,s,c,u,f){return e.apply(this,F(arguments,t,[n,r,o,i,s,c,u,f]))}}],L=function(e){var t=M(e,3),n=t[0],r=t[1],o=t[2],i=X(0,r.length-X(0,o.length-2)),s=D[i],c=s?s(n,i):D[0](n);if(r.prototype){var u=function(){};u.prototype=r.prototype,c.prototype=new u,u.prototype=null}return c},z=function(e,t){var n=e.apply(this,t);return A(n)===n?n:this},B=O?I.bind(k):function(e,t){q(e);var n,r=arguments,o=function(){var o=F(arguments,0,F(r,2));return this instanceof n?z.apply(this,[e,o]):e.apply(t,o)};return n=L([o,e,r])},G=TypeError,H=B.apply,R=B(B.call,H),V=B(H,{}.toString),J=function(e){if("function"!=typeof e&&"[object Function]"!==V(e))throw new G(e+" is not a function");return e},K=function(e,t){return R(J(e),t,F(arguments[2]))},Q={}.toString,U=function(e){return function(e){if("function"!=typeof e&&"[object Function]"!==K(Q,e))throw new TypeError("methodize called on incompatible "+e)}(e),function(){return K(e,arguments[0],F(arguments,1))}},W=new(0,/none/.constructor)("^[".concat(b,"]+")),Y=U("".replace),Z=function(e){return Y(p(e),W,"")},ee=parseInt,te=(0).constructor,ne=U("".charAt),re=/^[-+]?0[xX]/,oe=U(re.test);t.default=function(e,t){var n=Z(c(e));return""===ne(n,0)?NaN:ee(n,te(t)||(oe(re,n)?16:10))}}])});
//# sourceMappingURL=parse-int-x.min.js.map