Files
klz-cables.com/.pnpm-store/v10/files/9f/52e58a96a396c9425951bcced44cbe24fa34b0f8087ce7f84d98aab4553c02e93e2dd4028d57164420088672c07dbcabf1c5fbbe1a26639b3a24fad1d8b087
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

86 lines
2.2 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const WINDOW = core.GLOBAL_OBJ ;
const INTEGRATION_NAME = 'ReportingObserver';
const SETUP_CLIENTS = new WeakMap();
const _reportingObserverIntegration = ((options = {}) => {
const types = options.types || ['crash', 'deprecation', 'intervention'];
/** Handler for the reporting observer. */
function handler(reports) {
if (!SETUP_CLIENTS.has(core.getClient() )) {
return;
}
for (const report of reports) {
core.withScope(scope => {
scope.setExtra('url', report.url);
const label = `ReportingObserver [${report.type}]`;
let details = 'No details available';
if (report.body) {
// Object.keys doesn't work on ReportBody, as all properties are inherited
const plainBody
= {};
// eslint-disable-next-line guard-for-in
for (const prop in report.body) {
plainBody[prop] = report.body[prop];
}
scope.setExtra('body', plainBody);
if (report.type === 'crash') {
const body = report.body ;
// A fancy way to create a message out of crashId OR reason OR both OR fallback
details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;
} else {
const body = report.body ;
details = body.message || details;
}
}
core.captureMessage(`${label}: ${details}`);
});
}
}
return {
name: INTEGRATION_NAME,
setupOnce() {
if (!core.supportsReportingObserver()) {
return;
}
const observer = new (WINDOW ).ReportingObserver(
handler,
{
buffered: true,
types,
},
);
observer.observe();
},
setup(client) {
SETUP_CLIENTS.set(client, true);
},
};
}) ;
/**
* Reporting API integration - https://w3c.github.io/reporting/
*/
const reportingObserverIntegration = core.defineIntegration(_reportingObserverIntegration);
exports.reportingObserverIntegration = reportingObserverIntegration;
//# sourceMappingURL=reportingobserver.js.map