Files
klz-cables.com/.pnpm-store/v10/files/41/340344a7367f3efa34375dc3563b80df30d38888ea80a8fd9765ef9a8e8c4c703fabee17f499e6b406159a2575aa0aaad1e2a70b6278dd1580cb2acc5afe19
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

35 lines
969 B
Plaintext

import { parseBaggageHeader, objectToBaggageHeader } from '@sentry/core';
/**
* Merge two baggage headers into one, where the existing one takes precedence.
* The order of the existing baggage will be preserved, and new entries will be added to the end.
*/
function mergeBaggageHeaders(
existing,
baggage,
) {
if (!existing) {
return baggage;
}
const existingBaggageEntries = parseBaggageHeader(existing);
const newBaggageEntries = parseBaggageHeader(baggage);
if (!newBaggageEntries) {
return existing;
}
// Existing entries take precedence, ensuring order remains stable for minimal changes
const mergedBaggageEntries = { ...existingBaggageEntries };
Object.entries(newBaggageEntries).forEach(([key, value]) => {
if (!mergedBaggageEntries[key]) {
mergedBaggageEntries[key] = value;
}
});
return objectToBaggageHeader(mergedBaggageEntries);
}
export { mergeBaggageHeaders };
//# sourceMappingURL=baggage.js.map