Files
klz-cables.com/.pnpm-store/v10/files/a8/00a7e556923b517a16afb219c8aa68579b0d28c60b9f73b9dfc116ec0c2c6be6729e2b828a3cce4fc2d3ceb1d3fe1e4e84ce5b97034e8bf9d075f5d933254b
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

50 lines
1.3 KiB
Plaintext

import { WINDOW } from '../helpers.js';
/**
* Checks if the baggage header has Sentry values.
*/
function baggageHeaderHasSentryValues(baggageHeader) {
return baggageHeader.split(',').some(value => value.trim().startsWith('sentry-'));
}
/**
* Gets the full URL from a given URL string.
*/
function getFullURL(url) {
try {
// By adding a base URL to new URL(), this will also work for relative urls
// If `url` is a full URL, the base URL is ignored anyhow
const parsed = new URL(url, WINDOW.location.origin);
return parsed.href;
} catch {
return undefined;
}
}
/**
* Checks if the entry is a PerformanceResourceTiming.
*/
function isPerformanceResourceTiming(entry) {
return (
entry.entryType === 'resource' &&
'initiatorType' in entry &&
typeof (entry ).nextHopProtocol === 'string' &&
(entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest')
);
}
/**
* Creates a Headers object from a record of string key-value pairs, and returns undefined if it fails.
*/
function createHeadersSafely(headers) {
try {
return new Headers(headers);
} catch {
// noop
return undefined;
}
}
export { baggageHeaderHasSentryValues, createHeadersSafely, getFullURL, isPerformanceResourceTiming };
//# sourceMappingURL=utils.js.map