Files
klz-cables.com/.pnpm-store/v10/files/1b/3f203a713eb793fe0d92fa645a7bc64af24c55a8eae28ce707fbd9971422c624fa68d95ec1e01d3e0e0d49bfbae3789cf2ca4b132a8a67e8a5cc2b99fbed0e
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

39 lines
1.3 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugBuild = require('../debug-build.js');
const debugLogger = require('./debug-logger.js');
const string = require('./string.js');
const NOT_PROPAGATED_MESSAGE =
'[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:';
/**
* Check if a given URL should be propagated to or not.
* If no url is defined, or no trace propagation targets are defined, this will always return `true`.
* You can also optionally provide a decision map, to cache decisions and avoid repeated regex lookups.
*/
function shouldPropagateTraceForUrl(
url,
tracePropagationTargets,
decisionMap,
) {
if (typeof url !== 'string' || !tracePropagationTargets) {
return true;
}
const cachedDecision = decisionMap?.get(url);
if (cachedDecision !== undefined) {
debugBuild.DEBUG_BUILD && !cachedDecision && debugLogger.debug.log(NOT_PROPAGATED_MESSAGE, url);
return cachedDecision;
}
const decision = string.stringMatchesSomePattern(url, tracePropagationTargets);
decisionMap?.set(url, decision);
debugBuild.DEBUG_BUILD && !decision && debugLogger.debug.log(NOT_PROPAGATED_MESSAGE, url);
return decision;
}
exports.shouldPropagateTraceForUrl = shouldPropagateTraceForUrl;
//# sourceMappingURL=tracePropagationTargets.js.map