MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getSentryCarrier

Function getSentryCarrier

packages/core/src/carrier.ts:62–71  ·  view source on GitHub ↗
(carrier: Carrier)

Source from the content-addressed store, hash-verified

60
61/** Will either get the existing sentry carrier, or create a new one. */
62export function getSentryCarrier(carrier: Carrier): SentryCarrier {
63 const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});
64
65 // For now: First SDK that sets the .version property wins
66 __SENTRY__.version = __SENTRY__.version || SDK_VERSION;
67
68 // Intentionally populating and returning the version of "this" SDK instance
69 // rather than what's set in .version so that "this" SDK always gets its carrier
70 return (__SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {});
71}
72
73/**
74 * Returns a global singleton contained in the global `__SENTRY__[]` object.

Callers 10

clearGlobalScopeFunction · 0.90
carrier.test.tsFile · 0.90
envelope.test.tsFile · 0.90
logger.test.tsFile · 0.90
encodeUTF8Function · 0.90
decodeUTF8Function · 0.90
setAsyncContextStrategyFunction · 0.90
getAsyncContextStrategyFunction · 0.90
getAsyncContextStackFunction · 0.90
getMainCarrierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected