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

package.build.esm.utils.hasTracingEnabled.js.map Maven / Gradle / Ivy

There is a newer version: 8.39.0
Show newest version
{"version":3,"file":"hasTracingEnabled.js","sources":["../../../src/utils/hasTracingEnabled.ts"],"sourcesContent":["import type { Options } from '@sentry/types';\nimport { getClient } from '../currentScopes';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n  maybeOptions?: Pick | undefined,\n): boolean {\n  if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n    return false;\n  }\n\n  const options = maybeOptions || getClientOptions();\n  // eslint-disable-next-line deprecation/deprecation\n  return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n\nfunction getClientOptions(): Options | undefined {\n  const client = getClient();\n  return client && client.getOptions();\n}\n"],"names":[],"mappings":";;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,YAAY;AACd,EAAW;AACX,EAAE,IAAI,OAAO,kBAAA,KAAuB,SAAU,IAAG,CAAC,kBAAkB,EAAE;AACtE,IAAI,OAAO,KAAK,CAAA;AAChB,GAAE;AACF;AACA,EAAE,MAAM,OAAQ,GAAE,gBAAgB,gBAAgB,EAAE,CAAA;AACpD;AACA,EAAE,OAAO,CAAC,CAAC,OAAQ,KAAI,OAAO,CAAC,aAAc,IAAG,sBAAsB,OAAA,IAAW,eAAgB,IAAG,OAAO,CAAC,CAAA;AAC5G,CAAA;AACA;AACA,SAAS,gBAAgB,GAAwB;AACjD,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE,CAAA;AAC5B,EAAE,OAAO,MAAO,IAAG,MAAM,CAAC,UAAU,EAAE,CAAA;AACtC;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy