/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/error-to-json@2.0.1/dist/cjs/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.parse=void 0;const fast_safe_stringify_1=__importDefault(require("fast-safe-stringify"));exports.default=errToJSON;const nonEnumerablePropsToCopy=["code","errno","syscall"];function errToJSON(t){let e;if("function"==typeof t.toJSON)e=t.toJSON();else{let r="toJSON"in Error.prototype;const o=Error.prototype.toJSON,s=function(){const t=Object.assign(Object.assign({},this),{name:this.name,message:this.message,stack:this.stack});return nonEnumerablePropsToCopy.forEach((e=>{e in this&&(t[e]=this[e])})),JSON.parse(fast_safe_stringify_1.default(t))};try{Error.prototype.toJSON=s}catch(t){r=!1}r&&"function"==typeof t.toJSON?e=t.toJSON():(r=!1,e=s.call(t)),r&&(Error.prototype.toJSON=o)}return e}function parse(t){const e=new Error(t.message),r=e.stack||"";return Object.assign(e,t),e.stack===r&&(e.stack=r.slice(0,r.indexOf("\n"))),e}exports.parse=parse;
//# sourceMappingURL=/sm/1b2e0e8c643444f8e5d89158b3adb96c7e5463eddc944b5258f2a26a6042579d.map