UNPKG

@sentry/core

Version:
21 lines (18 loc) 773 B
import { SDK_VERSION } from './utils/version.js'; import { GLOBAL_OBJ } from './utils/worldwide.js'; function getMainCarrier() { getSentryCarrier(GLOBAL_OBJ); return GLOBAL_OBJ; } function getSentryCarrier(carrier) { const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {}; __SENTRY__.version = __SENTRY__.version || SDK_VERSION; return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; } function getGlobalSingleton(name, creator, obj = GLOBAL_OBJ) { const __SENTRY__ = obj.__SENTRY__ = obj.__SENTRY__ || {}; const carrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; return carrier[name] || (carrier[name] = creator()); } export { getGlobalSingleton, getMainCarrier, getSentryCarrier }; //# sourceMappingURL=carrier.js.map