All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.cjs.asyncContext.index.js.map Maven / Gradle / Ivy

There is a newer version: 8.39.0
Show newest version
{"version":3,"file":"index.js","sources":["../../../src/asyncContext/index.ts"],"sourcesContent":["import type { Carrier } from './../carrier';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport { getStackAsyncContextStrategy } from './stackStrategy';\nimport type { AsyncContextStrategy } from './types';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n  const sentry = getSentryCarrier(registry);\n  sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nexport function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy {\n  const sentry = getSentryCarrier(carrier);\n\n  if (sentry.acs) {\n    return sentry.acs;\n  }\n\n  // Otherwise, use the default one (stack)\n  return getStackAsyncContextStrategy();\n}\n"],"names":["getMainCarrier","getSentryCarrier","carrier","getStackAsyncContextStrategy"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,QAAQ,EAA0C;AAC1F;AACA,EAAE,MAAM,QAAA,GAAWA,sBAAc,EAAE,CAAA;AACnC,EAAE,MAAM,MAAO,GAAEC,wBAAgB,CAAC,QAAQ,CAAC,CAAA;AAC3C,EAAE,MAAM,CAAC,GAAI,GAAE,QAAQ,CAAA;AACvB,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAACC,SAAO,EAAiC;AAChF,EAAE,MAAM,MAAO,GAAED,wBAAgB,CAACC,SAAO,CAAC,CAAA;AAC1C;AACA,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE;AAClB,IAAI,OAAO,MAAM,CAAC,GAAG,CAAA;AACrB,GAAE;AACF;AACA;AACA,EAAE,OAAOC,0CAA4B,EAAE,CAAA;AACvC;;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy