parse-json-bignumber
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -70,4 +70,8 @@ "use strict"; | ||
else { | ||
if (string.length > 15) | ||
if (string.length > 15) { | ||
return string; | ||
} | ||
else { | ||
return number; | ||
} | ||
} | ||
@@ -74,0 +78,0 @@ }, string = function () { |
@@ -1,1 +0,1 @@ | ||
(function(a,b){if('function'==typeof define&&define.amd)define(['module'],b);else if('undefined'!=typeof exports)b(module);else{var c={exports:{}};b(c),a.parseJsonBignumber=c.exports}})(this,function(a){'use strict';a.exports=function(a){var b={strict:!1};void 0!==a&&null!==a&&!0===a.strict&&(b.strict=!0);var d,e,f,c,g={'"':'"',"\\":'\\',"/":'/',b:'\b',f:'\f',n:'\n',r:'\r',t:'\t'},h=function(a){throw{name:'SyntaxError',message:a,at:d,text:f}},j=function(a){return a&&a!==e&&h('Expected \''+a+'\' instead of \''+e+'\''),e=f.charAt(d),d+=1,e},i=function(){var a,b='';for('-'===e&&(b='-',j('-'));'0'<=e&&'9'>=e;)b+=e,j();if('.'===e)for(b+='.';j()&&'0'<=e&&'9'>=e;)b+=e;if('e'===e||'E'===e)for(b+=e,j(),('-'===e||'+'===e)&&(b+=e,j());'0'<=e&&'9'>=e;)b+=e,j();if(a=+b,!isFinite(a))h('Bad number');else if(15<b.length)return b},k=function(){var a,b,c,d='';if('"'===e)for(;j();){if('"'===e)return j(),d;if('\\'!==e)d+=e;else if(j(),'u'===e){for(c=0,b=0;4>b&&(a=parseInt(j(),16),!!isFinite(a));b+=1)c=16*c+a;d+=String.fromCharCode(c)}else if('string'==typeof g[e])d+=g[e];else break}h('Bad string')},l=function(){for(;e&&' '>=e;)j()},m=function(){switch(e){case't':return j('t'),j('r'),j('u'),j('e'),!0;case'f':return j('f'),j('a'),j('l'),j('s'),j('e'),!1;case'n':return j('n'),j('u'),j('l'),j('l'),null;}h('Unexpected \''+e+'\'')},n=function(){var a=[];if('['===e){if(j('['),l(),']'===e)return j(']'),a;for(;e;){if(a.push(c()),l(),']'===e)return j(']'),a;j(','),l()}}h('Bad array')},o=function(){var a,d={};if('{'===e){if(j('{'),l(),'}'===e)return j('}'),d;for(;e;){if(a=k(),l(),j(':'),!0===b.strict&&Object.hasOwnProperty.call(d,a)&&h('Duplicate key "'+a+'"'),d[a]=c(),l(),'}'===e)return j('}'),d;j(','),l()}}h('Bad object')};return c=function(){return l(),'{'===e?o():'['===e?n():'"'===e?k():'-'===e?i():'0'<=e&&'9'>=e?i():m()},function(a,b){var g;return f=a+'',d=0,e=' ',g=c(),l(),e&&h('Syntax error'),'function'==typeof b?function a(c,d){var e,f=c[d];return f&&'object'==typeof f&&Object.keys(f).forEach(function(b){e=a(f,b),void 0===e?delete f[b]:f[b]=e}),b.call(c,d,f)}({"":g},''):g}}}); | ||
(function(a,b){if('function'==typeof define&&define.amd)define(['module'],b);else if('undefined'!=typeof exports)b(module);else{var c={exports:{}};b(c),a.parseJsonBignumber=c.exports}})(this,function(a){'use strict';a.exports=function(a){var b={strict:!1};void 0!==a&&null!==a&&!0===a.strict&&(b.strict=!0);var d,e,f,c,g={'"':'"',"\\":'\\',"/":'/',b:'\b',f:'\f',n:'\n',r:'\r',t:'\t'},h=function(a){throw{name:'SyntaxError',message:a,at:d,text:f}},j=function(a){return a&&a!==e&&h('Expected \''+a+'\' instead of \''+e+'\''),e=f.charAt(d),d+=1,e},i=function(){var a,b='';for('-'===e&&(b='-',j('-'));'0'<=e&&'9'>=e;)b+=e,j();if('.'===e)for(b+='.';j()&&'0'<=e&&'9'>=e;)b+=e;if('e'===e||'E'===e)for(b+=e,j(),('-'===e||'+'===e)&&(b+=e,j());'0'<=e&&'9'>=e;)b+=e,j();return a=+b,isFinite(a)?15<b.length?b:a:void h('Bad number')},k=function(){var a,b,c,d='';if('"'===e)for(;j();){if('"'===e)return j(),d;if('\\'!==e)d+=e;else if(j(),'u'===e){for(c=0,b=0;4>b&&(a=parseInt(j(),16),!!isFinite(a));b+=1)c=16*c+a;d+=String.fromCharCode(c)}else if('string'==typeof g[e])d+=g[e];else break}h('Bad string')},l=function(){for(;e&&' '>=e;)j()},m=function(){switch(e){case't':return j('t'),j('r'),j('u'),j('e'),!0;case'f':return j('f'),j('a'),j('l'),j('s'),j('e'),!1;case'n':return j('n'),j('u'),j('l'),j('l'),null;}h('Unexpected \''+e+'\'')},n=function(){var a=[];if('['===e){if(j('['),l(),']'===e)return j(']'),a;for(;e;){if(a.push(c()),l(),']'===e)return j(']'),a;j(','),l()}}h('Bad array')},o=function(){var a,d={};if('{'===e){if(j('{'),l(),'}'===e)return j('}'),d;for(;e;){if(a=k(),l(),j(':'),!0===b.strict&&Object.hasOwnProperty.call(d,a)&&h('Duplicate key "'+a+'"'),d[a]=c(),l(),'}'===e)return j('}'),d;j(','),l()}}h('Bad object')};return c=function(){return l(),'{'===e?o():'['===e?n():'"'===e?k():'-'===e?i():'0'<=e&&'9'>=e?i():m()},function(a,b){var g;return f=a+'',d=0,e=' ',g=c(),l(),e&&h('Syntax error'),'function'==typeof b?function a(c,d){var e,f=c[d];return f&&'object'==typeof f&&Object.keys(f).forEach(function(b){e=a(f,b),void 0===e?delete f[b]:f[b]=e}),b.call(c,d,f)}({"":g},''):g}}}); |
{ | ||
"name": "parse-json-bignumber", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"dependencies": {}, | ||
"main": "dist/parse-json-bignumber.min.js", | ||
"scripts": { | ||
@@ -6,0 +7,0 @@ "build": "rm -rf ./dist && tsc -p ./ && babel ./dist/parse-json-bignumber.js -o ./dist/parse-json-bignumber.min.js", |
@@ -85,4 +85,7 @@ const create = function (options?) { | ||
} else { | ||
if (string.length > 15) | ||
if (string.length > 15) { | ||
return string; | ||
} else { | ||
return number | ||
} | ||
} | ||
@@ -89,0 +92,0 @@ }, |
23010
721