MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getSpotlightConfig

Function getSpotlightConfig

packages/node-core/src/utils/spotlight.ts:9–25  ·  view source on GitHub ↗
(optionsSpotlight: boolean | string | undefined)

Source from the content-addressed store, hash-verified

7 * - `undefined`: defer entirely to the env var (bool or URL)
8 */
9export function getSpotlightConfig(optionsSpotlight: boolean | string | undefined): boolean | string | undefined {
10 if (optionsSpotlight === false) {
11 return false;
12 }
13
14 if (typeof optionsSpotlight === 'string') {
15 return optionsSpotlight;
16 }
17
18 // optionsSpotlight is true or undefined
19 const envBool = envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true });
20 const envUrl = envBool === null && process.env.SENTRY_SPOTLIGHT ? process.env.SENTRY_SPOTLIGHT : undefined;
21
22 return optionsSpotlight === true
23 ? (envUrl ?? true) // true: use env URL if present, otherwise true
24 : (envBool ?? envUrl); // undefined: use env var (bool or URL)
25}

Callers 3

spotlight.test.tsFile · 0.90
getClientOptionsFunction · 0.90
getClientOptionsFunction · 0.90

Calls 1

envToBoolFunction · 0.90

Tested by

no test coverage detected