Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
1 KiB
Text
36 lines
1 KiB
Text
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
const core = require('@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 = core.parseBaggageHeader(existing);
|
|
const newBaggageEntries = core.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 core.objectToBaggageHeader(mergedBaggageEntries);
|
|
}
|
|
|
|
exports.mergeBaggageHeaders = mergeBaggageHeaders;
|
|
//# sourceMappingURL=baggage.js.map
|