forked from wojodesign/simplecart-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimpleCart-JSON.min.js
More file actions
1 lines (1 loc) · 2.67 KB
/
simpleCart-JSON.min.js
File metadata and controls
1 lines (1 loc) · 2.67 KB
1
var JSON;JSON||(JSON={}),function(){function k(t){return 10>t?"0"+t:t}function o(t){return p.lastIndex=0,p.test(t)?'"'+t.replace(p,function(t){var e=r[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function l(t,r){var f,u,a,c,p,s=e,y=r[t];switch(y&&"object"==typeof y&&"function"==typeof y.toJSON&&(y=y.toJSON(t)),"function"==typeof i&&(y=i.call(r,t,y)),typeof y){case"string":return o(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":return String(y);case"object":if(!y)return"null";if(e+=n,p=[],"[object Array]"===Object.prototype.toString.apply(y)){for(c=y.length,f=0;c>f;f+=1)p[f]=l(f,y)||"null";return a=0===p.length?"[]":e?"[\n"+e+p.join(",\n"+e)+"\n"+s+"]":"["+p.join(",")+"]",e=s,a}if(i&&"object"==typeof i)for(c=i.length,f=0;c>f;f+=1)"string"==typeof i[f]&&(u=i[f],(a=l(u,y))&&p.push(o(u)+(e?": ":":")+a));else{for(u in y)Object.prototype.hasOwnProperty.call(y,u)&&(a=l(u,y))&&p.push(o(u)+(e?": ":":")+a);a=0===p.length?"{}":e?"{\n"+e+p.join(",\n"+e)+"\n"+s+"}":"{"+p.join(",")+"}"}return e=s,a}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,n,r={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,r,o){var f;if(n=e="","number"==typeof o)for(f=0;o>f;f+=1)n+=" ";else"string"==typeof o&&(n=o);if((i=r)&&"function"!=typeof r&&("object"!=typeof r||"number"!=typeof r.length))throw Error("JSON.stringify");return l("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(a,e){function c(t,n){var r,o,f=t[n];if(f&&"object"==typeof f)for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(o=c(f,r),void 0!==o?f[r]=o:delete f[r]);return e.call(t,n,f)}var d,a=String(a);if(q.lastIndex=0,q.test(a)&&(a=a.replace(q,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d=eval("("+a+")"),"function"==typeof e?c({"":d},""):d;throw new SyntaxError("JSON.parse")})}();