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

package.build.esm.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":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,QAAQ,EAA0C;AAC1F;AACA,EAAE,MAAM,QAAA,GAAW,cAAc,EAAE,CAAA;AACnC,EAAE,MAAM,MAAO,GAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAA;AAC3C,EAAE,MAAM,CAAC,GAAI,GAAE,QAAQ,CAAA;AACvB,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,OAAO,EAAiC;AAChF,EAAE,MAAM,MAAO,GAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;AAC1C;AACA,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE;AAClB,IAAI,OAAO,MAAM,CAAC,GAAG,CAAA;AACrB,GAAE;AACF;AACA;AACA,EAAE,OAAO,4BAA4B,EAAE,CAAA;AACvC;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy