{"size": 7466, "ext": "js", "max_stars_repo_path": "node_modules/lossless-json/dist/lossless-json.js", "max_stars_repo_name": "Pranjalya/common", "max_stars_repo_stars_event_min_datetime": "2020-03-24T14:22:42.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-17T11:57:48.000Z", "max_issues_repo_path": "node_modules/lossless-json/dist/lossless-json.js", "max_issues_repo_name": "hbeychaner/common", "max_issues_repo_issues_event_min_datetime": "2020-03-27T16:55:05.000Z", "max_issues_repo_issues_event_max_datetime": "2020-04-10T01:24:37.000Z", "max_forks_repo_path": "node_modules/lossless-json/dist/lossless-json.js", "max_forks_repo_name": "hbeychaner/common", "max_forks_repo_forks_event_min_datetime": "2020-03-25T00:01:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-07T18:24:22.000Z"}
{"max_stars_count": 9, "max_issues_count": 4, "max_forks_count": 25, "avg_line_length": 2488.6666666667, "max_line_length": 7423, "alphanum_fraction": 0.6075542459}
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(r.LosslessJSON={})}(this,function(r){"use strict";var e=!0;function n(r){return r&&void 0!==r.circularRefs&&null!==r.circularRefs&&(e=!0===r.circularRefs),{circularRefs:e}}var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},o=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function r(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}return function(e,n,t){return n&&r(e.prototype,n),t&&r(e,t),e}}(),f=function(){function r(e){o(this,r),this.value=function r(e){if("string"==typeof e){if(!function(r){return/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(r)}(e))throw new Error('Invalid number (value: "'+e+'")');return e}if("number"==typeof e){if(u(e+"").length>15)throw new Error("Invalid number: contains more than 15 digits (value: "+e+")");if(isNaN(e))throw new Error("Invalid number: NaN");if(!isFinite(e))throw new Error("Invalid number: Infinity");return e+""}return r(e&&e.valueOf())}(e),this.type="LosslessNumber",this.isLosslessNumber=!0}return i(r,[{key:"valueOf",value:function(){var r=parseFloat(this.value),e=u(this.value);if(e.length>15)throw new Error("Cannot convert to number: number would be truncated (value: "+this.value+")");if(!isFinite(r))throw new Error("Cannot convert to number: number would overflow (value: "+this.value+")");if(Math.abs(r)<Number.MIN_VALUE&&!/^0*$/.test(e))throw new Error("Cannot convert to number: number would underflow (value: "+this.value+")");return r}},{key:"toString",value:function(){return this.value}}]),r}();function u(r){return("string"!=typeof r?r+"":r).replace(/^-/,"").replace(/e.*$/,"").replace(/^0\.?0*|\./,"")}function a(r,e,n,o){return Array.isArray(n)?o.call(r,e,function(r,e){for(var n=[],t=0;t<r.length;t++)n[t]=a(r,t+"",r[t],e);return n}(n,o)):n&&"object"===(void 0===n?"undefined":t(n))&&!n.isLosslessNumber?o.call(r,e,function(r,e){var n={};for(var t in r)r.hasOwnProperty(t)&&(n[t]=a(r,t,r[t],e));return n}(n,o)):o.call(r,e,n)}function c(r){return encodeURIComponent(r.replace(/\//g,"~1").replace(/~/g,"~0"))}function l(r){return decodeURIComponent(r).replace(/~1/g,"/").replace(/~0/g,"~")}function s(r){return"#/"+r.map(c).join("/")}var v={NULL:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4,UNKNOWN:5},h={"":!0,"{":!0,"}":!0,"[":!0,"]":!0,":":!0,",":!0},d={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},p="",y=0,b="",g="",m=v.NULL,w=[],I=[];function E(){y++,b=p.charAt(y)}function N(){for(m=v.NULL,g="";" "===b||"\t"===b||"\n"===b||"\r"===b;)E();if(h[b])return m=v.DELIMITER,g=b,void E();if(S(b)||"-"===b){if(m=v.NUMBER,"-"===b){if(g+=b,E(),!S(b))throw M("Invalid number, digit expected",y)}else"0"===b&&(g+=b,E());for(;S(b);)g+=b,E();if("."===b){if(g+=b,E(),!S(b))throw M("Invalid number, digit expected",y);for(;S(b);)g+=b,E()}if("e"===b||"E"===b){if(g+=b,E(),"+"!==b&&"-"!==b||(g+=b,E()),!S(b))throw M("Invalid number, digit expected",y);for(;S(b);)g+=b,E()}}else if('"'!==b){if(!L(b)){for(m=v.UNKNOWN;""!==b;)g+=b,E();throw M('Syntax error in part "'+g+'"')}for(m=v.SYMBOL;L(b);)g+=b,E()}else{for(m=v.STRING,E();""!==b&&'"'!==b;)if("\\"===b){E();var r=d[b];if(void 0!==r)g+=r,E();else{if("u"!==b)throw M('Invalid escape character "\\'+b+'"',y);E();for(var e="",n=0;n<4;n++){if(!R(b))throw M("Invalid unicode character");e+=b,E()}g+=String.fromCharCode(parseInt(e,16))}}else g+=b,E();if('"'!==b)throw M("End of string expected");E()}}function L(r){return/^[a-zA-Z_]/.test(r)}function R(r){return/^[0-9a-fA-F]/.test(r)}function S(r){return r>="0"&&r<="9"}function M(r,e){void 0===e&&(e=y-g.length);var n=new SyntaxError(r+" (char "+e+")");return n.char=e,n}function O(){if(m===v.DELIMITER&&"{"===g){N();var r=void 0,e={};if(m===v.DELIMITER&&"}"===g)return N(),e;var t=I.length;for(I[t]=e;;){if(m!==v.STRING)throw M("Object key expected");if(r=g,N(),m!==v.DELIMITER||":"!==g)throw M("Colon expected");if(N(),w[t]=r,e[r]=O(),m!==v.DELIMITER||","!==g)break;N()}if(m!==v.DELIMITER||"}"!==g)throw M('Comma or end of object "}" expected');return N(),function(r){return"string"==typeof r.$ref&&1===Object.keys(r).length}(e)?function(r){if(!n().circularRefs)return r;for(var e=function(r){var e=r.split("/").map(l);if("#"!==e.shift())throw SyntaxError("Cannot parse JSON Pointer: no valid URI fragment");return""===e[e.length-1]&&e.pop(),e}(r.$ref),t=0;t<e.length;t++)if(e[t]!==w[t])throw new Error('Invalid circular reference "'+r.$ref+'"');return I[e.length]}(e):(I.length=t,w.length=t,e)}return function(){if(m===v.DELIMITER&&"["===g){N();var r=[];if(m===v.DELIMITER&&"]"===g)return N(),r;var e=I.length;for(I[e]=r;w[e]=r.length+"",r.push(O()),m===v.DELIMITER&&","===g;)N();if(m!==v.DELIMITER||"]"!==g)throw M('Comma or end of array "]" expected');return N(),I.length=e,w.length=e,r}return function(){if(m===v.STRING){var r=g;return N(),r}return function(){if(m===v.NUMBER){var r=new f(g);return N(),r}return function(){if(m===v.SYMBOL){if("true"===g)return N(),!0;if("false"===g)return N(),!1;if("null"===g)return N(),null;throw M('Unknown symbol "'+g+'"')}return function(){throw M(""===g?"Unexpected end of json string":"Value expected")}()}()}()}()}()}var x=[],T=[];function U(r,e,n){T=[],x=[];var t="function"==typeof e?e.call({"":r},"",r):r,o=void 0;return"number"==typeof n?n>10?o=B(" ",10):n>=1&&(o=B(" ",n)):"string"==typeof n&&""!==n&&(o=n),C(t,e,o,"")}function C(r,e,n,o){return"boolean"==typeof r||r instanceof Boolean||null===r||"number"==typeof r||r instanceof Number||"string"==typeof r||r instanceof String||r instanceof Date?JSON.stringify(r):r&&r.isLosslessNumber?r.value:Array.isArray(r)?function(r,e,n,t){var o=n?t+n:void 0,i=n?"[\n":"[";if(A(r))return j(r,e,n,t);var f=T.length;T[f]=r;for(var u=0;u<r.length;u++){var a=u+"",c="function"==typeof e?e.call(r,a,r[u]):r[u];n&&(i+=o),void 0!==c&&"function"!=typeof c?(x[f]=a,i+=C(c,e,n,o)):i+="null",u<r.length-1&&(i+=n?",\n":",")}return T.length=f,x.length=f,i+=n?"\n"+t+"]":"]"}(r,e,n,o):r&&"object"===(void 0===r?"undefined":t(r))?D(r,e,n,o):void 0}function D(r,e,n,t){var o=n?t+n:void 0,i=!0,f=n?"{\n":"{";if("function"==typeof r.toJSON)return U(r.toJSON(),e,n);if(A(r))return j(r,e,n,t);var u=T.length;for(var a in T[u]=r,r)if(r.hasOwnProperty(a)){var c="function"==typeof e?e.call(r,a,r[a]):r[a];k(a,c,e)&&(i?i=!1:f+=n?",\n":",",f+=n?o+'"'+a+'": ':'"'+a+'":',x[u]=a,f+=C(c,e,n,o))}return T.length=u,x.length=u,f+=n?"\n"+t+"}":"}"}function A(r){return-1!==T.indexOf(r)}function j(r,e,t,o){if(!n().circularRefs)throw new Error('Circular reference at "'+s(x)+'"');var i=T.indexOf(r);return D({$ref:s(x.slice(0,i))},e,t,o)}function k(r,e,n){return void 0!==e&&"function"!=typeof e&&(!Array.isArray(n)||function(r,e){for(var n=0;n<r.length;n++)if(r[n]==e)return!0;return!1}(n,r))}function B(r,e){for(var n="";e-- >0;)n+=r;return n}r.config=n,r.parse=function(r,e){y=0,b=(p=r).charAt(0),g="",m=v.NULL,I=[],w=[],N();var n=O();if(""!==g)throw M("Unexpected characters");return e?function(r,e){return a({"":r},"",r,e)}(n,e):n},r.stringify=U,r.LosslessNumber=f,Object.defineProperty(r,"__esModule",{value:!0})});
//# sourceMappingURL=lossless-json.js.map
