const t=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,r=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,e=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function u(t,r){if(!("__proto__"===t||"constructor"===t&&r&&"object"==typeof r&&"prototype"in r))return r}function n(n,s={}){if("string"!=typeof n)return n;if('"'===n[0]&&'"'===n[n.length-1]&&-1===n.indexOf("\\"))return n.slice(1,-1);const i=n.trim();if(i.length<=9)switch(i.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!e.test(n)){if(s.strict)throw new SyntaxError("[destr] Invalid JSON");return n}try{if(t.test(n)||r.test(n)){if(s.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(n,u)}return JSON.parse(n)}catch(o){if(s.strict)throw o;return n}}export{n as d};
//# sourceMappingURL=destr-9c6e2924.js.map
