package.build.cjs.utils.hasTracingEnabled.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Base implementation for all Sentry JavaScript SDKs
{"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":["getClient"],"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,GAASA,uBAAS,EAAE,CAAA;AAC5B,EAAE,OAAO,MAAO,IAAG,MAAM,CAAC,UAAU,EAAE,CAAA;AACtC;;;;"}