Files
klz-cables.com/.pnpm-store/v10/files/1e/800a8c633be83e701fa48656f8c7d27af317dfda2f19d8b62e89bfc91c3a80e068ba928ebfff45b5e1918b757af493bac0394005d803cb1a3fc2530dc2bef3
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

49 lines
1.6 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const worldwide = require('./worldwide.js');
// undefined = not yet resolved, null = no runner found, function = runner found
let RESOLVED_RUNNER;
/**
* Simple wrapper that allows SDKs to *secretly* set context wrapper to generate safe random IDs in cache components contexts
*/
function withRandomSafeContext(cb) {
// Skips future symbol lookups if we've already resolved (or attempted to resolve) the runner once
if (RESOLVED_RUNNER !== undefined) {
return RESOLVED_RUNNER ? RESOLVED_RUNNER(cb) : cb();
}
const sym = Symbol.for('__SENTRY_SAFE_RANDOM_ID_WRAPPER__');
const globalWithSymbol = worldwide.GLOBAL_OBJ;
if (sym in globalWithSymbol && typeof globalWithSymbol[sym] === 'function') {
RESOLVED_RUNNER = globalWithSymbol[sym];
return RESOLVED_RUNNER(cb);
}
RESOLVED_RUNNER = null;
return cb();
}
/**
* Identical to Math.random() but wrapped in withRandomSafeContext
* to ensure safe random number generation in certain contexts (e.g., Next.js Cache Components).
*/
function safeMathRandom() {
return withRandomSafeContext(() => Math.random());
}
/**
* Identical to Date.now() but wrapped in withRandomSafeContext
* to ensure safe time value generation in certain contexts (e.g., Next.js Cache Components).
*/
function safeDateNow() {
return withRandomSafeContext(() => Date.now());
}
exports.safeDateNow = safeDateNow;
exports.safeMathRandom = safeMathRandom;
exports.withRandomSafeContext = withRandomSafeContext;
//# sourceMappingURL=randomSafeContext.js.map