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AHA,QAAQ,QAAU","file":"/npm/@blued-core/exception-report-client@0.1.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@blued-core/exception-report-client@0.1.1/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n    result[\"default\"] = mod;\n    return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst Sentry = __importStar(require(\"@sentry/node\"));\nconst client_1 = __importDefault(require(\"@blued-core/client\"));\nlet flag = true;\nconst EventCache = new Map();\nconst LoopSecond = 10;\nconst ExpireSecond = 60;\nclass ExceptionReportClient extends client_1.default {\n    buildClient(key) {\n        if (flag) {\n            flag = false;\n            const conf = this.conf.get(key);\n            Sentry.init(Object.assign({ dsn: !this.isLocal && conf, debug: this.isLocal, beforeSend: (e, hints) => {\n                    const error = getErrorKey(hints.originalException);\n                    if (EventCache.has(error) && Date.now() - EventCache.get(error) < ExpireSecond * 1e3) {\n                        return null;\n                    }\n                    else {\n                        EventCache.set(error, Date.now());\n                        return e;\n                    }\n                } }, this.option));\n            // 处理缓存错误的有效期\n            setInterval(() => {\n                EventCache.forEach((v, k) => {\n                    if (Date.now() - v >= ExpireSecond * 1e3) {\n                        EventCache.delete(k);\n                    }\n                });\n            }, LoopSecond * 1e3);\n        }\n        return {\n            client: Sentry,\n            clean() { },\n        };\n    }\n}\nexports.default = ExceptionReportClient;\nfunction getErrorKey(e) {\n    return typeof e === 'string' ? e : [e.name, e.message, e.stack].join(' ');\n}\n"]}