UNPKG

@forbespro/lead-agent

Version:
80 lines (79 loc) 2.69 kB
import { getDefaultExportFromCjs as _ } from "./index31.js"; import { __module as u } from "./index44.js"; const m = typeof Buffer != "undefined", i = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, l = /"(?: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*:/; function p(r, o, e) { e == null && o !== null && typeof o == "object" && (e = o, o = void 0), m && Buffer.isBuffer(r) && (r = r.toString()), r && r.charCodeAt(0) === 65279 && (r = r.slice(1)); const t = JSON.parse(r, o); if (t === null || typeof t != "object") return t; const n = e && e.protoAction || "error", c = e && e.constructorAction || "error"; if (n === "ignore" && c === "ignore") return t; if (n !== "ignore" && c !== "ignore") { if (i.test(r) === !1 && l.test(r) === !1) return t; } else if (n !== "ignore" && c === "ignore") { if (i.test(r) === !1) return t; } else if (l.test(r) === !1) return t; return y(t, { protoAction: n, constructorAction: c, safe: e && e.safe }); } function y(r, { protoAction: o = "error", constructorAction: e = "error", safe: t } = {}) { let n = [r]; for (; n.length; ) { const c = n; n = []; for (const s of c) { if (o !== "ignore" && Object.prototype.hasOwnProperty.call(s, "__proto__")) { if (t === !0) return null; if (o === "error") throw new SyntaxError("Object contains forbidden prototype property"); delete s.__proto__; } if (e !== "ignore" && Object.prototype.hasOwnProperty.call(s, "constructor") && Object.prototype.hasOwnProperty.call(s.constructor, "prototype")) { if (t === !0) return null; if (e === "error") throw new SyntaxError("Object contains forbidden prototype property"); delete s.constructor; } for (const d in s) { const f = s[d]; f && typeof f == "object" && n.push(f); } } } return r; } function a(r, o, e) { const t = Error.stackTraceLimit; Error.stackTraceLimit = 0; try { return p(r, o, e); } finally { Error.stackTraceLimit = t; } } function E(r, o) { const e = Error.stackTraceLimit; Error.stackTraceLimit = 0; try { return p(r, o, { safe: !0 }); } catch (t) { return null; } finally { Error.stackTraceLimit = e; } } u.exports = a; u.exports.default = a; u.exports.parse = a; u.exports.safeParse = E; u.exports.scan = y; var F = u.exports; const b = /* @__PURE__ */ _(F); export { b as default };