Files
klz-cables.com/.pnpm-store/v10/files/e8/50c25cd72e3a60a73df15f5f55906cfe5b6491a72e6fc608d0c7b8dc9789f321335b331adb81f3fea4e098caf559153e1b70c5e7d9c85467b1e8662a978c59
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

54 lines
1.7 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const currentScopes = require('../currentScopes.js');
const integration = require('../integration.js');
const object = require('../utils/object.js');
let originalFunctionToString;
const INTEGRATION_NAME = 'FunctionToString';
const SETUP_CLIENTS = new WeakMap();
const _functionToStringIntegration = (() => {
return {
name: INTEGRATION_NAME,
setupOnce() {
// eslint-disable-next-line @typescript-eslint/unbound-method
originalFunctionToString = Function.prototype.toString;
// intrinsics (like Function.prototype) might be immutable in some environments
// e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)
try {
Function.prototype.toString = function ( ...args) {
const originalFunction = object.getOriginalFunction(this);
const context =
SETUP_CLIENTS.has(currentScopes.getClient() ) && originalFunction !== undefined ? originalFunction : this;
return originalFunctionToString.apply(context, args);
};
} catch {
// ignore errors here, just don't patch this
}
},
setup(client) {
SETUP_CLIENTS.set(client, true);
},
};
}) ;
/**
* Patch toString calls to return proper name for wrapped functions.
*
* ```js
* Sentry.init({
* integrations: [
* functionToStringIntegration(),
* ],
* });
* ```
*/
const functionToStringIntegration = integration.defineIntegration(_functionToStringIntegration);
exports.functionToStringIntegration = functionToStringIntegration;
//# sourceMappingURL=functiontostring.js.map