Files
klz-cables.com/.pnpm-store/v10/files/6d/78170b8fc8f72bbeffc030e9151b657099d17b1a853199f56a969e023697d14cafbe0971cbeba3fe43b88955921b42bceb317dd203906e69dd7084a77e5ef1
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

63 lines
1.3 KiB
Plaintext

import { defineIntegration } from '@sentry/core';
import { WINDOW } from '../helpers.js';
const INTEGRATION_NAME = 'CultureContext';
const _cultureContextIntegration = (() => {
return {
name: INTEGRATION_NAME,
preprocessEvent(event) {
const culture = getCultureContext();
if (culture) {
event.contexts = {
...event.contexts,
culture: { ...culture, ...event.contexts?.culture },
};
}
},
};
}) ;
/**
* Captures culture context from the browser.
*
* Enabled by default.
*
* @example
* ```js
* import * as Sentry from '@sentry/browser';
*
* Sentry.init({
* integrations: [Sentry.cultureContextIntegration()],
* });
* ```
*/
const cultureContextIntegration = defineIntegration(_cultureContextIntegration);
/**
* Returns the culture context from the browser's Intl API.
*/
function getCultureContext() {
try {
const intl = (WINDOW ).Intl;
if (!intl) {
return undefined;
}
const options = intl.DateTimeFormat().resolvedOptions();
return {
locale: options.locale,
timezone: options.timeZone,
calendar: options.calendar,
};
} catch {
// Ignore errors
return undefined;
}
}
export { cultureContextIntegration };
//# sourceMappingURL=culturecontext.js.map