UNPKG

@sentry/nextjs

Version:
27 lines (23 loc) • 836 B
Object.defineProperty(exports, '__esModule', { value: true }); const commonMap = new WeakMap(); /** * Takes a shared (garbage collectable) object between resources, e.g. a headers object shared between Next.js server components and returns a common propagation context. */ function commonObjectToPropagationContext( commonObject, propagationContext, ) { if (typeof commonObject === 'object' && commonObject) { const memoPropagationContext = commonMap.get(commonObject); if (memoPropagationContext) { return memoPropagationContext; } else { commonMap.set(commonObject, propagationContext); return propagationContext; } } else { return propagationContext; } } exports.commonObjectToPropagationContext = commonObjectToPropagationContext; //# sourceMappingURL=commonObjectTracing.js.map