UNPKG

@azure/opentelemetry-instrumentation-azure-sdk

Version:
35 lines 1.18 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.environmentCache = exports.SDK_VERSION = void 0; exports.envVarToBoolean = envVarToBoolean; exports.SDK_VERSION = "1.0.0-beta.9"; /** * @internal * * Cached values of environment variables that were fetched. */ exports.environmentCache = new Map(); /** * Converts an environment variable to Boolean. * the strings "false" and "0" are treated as falsy values. * * @internal */ function envVarToBoolean(key) { var _a; if (!exports.environmentCache.has(key)) { loadEnvironmentVariable(key); } const value = ((_a = exports.environmentCache.get(key)) !== null && _a !== void 0 ? _a : "").toLowerCase(); return value !== "false" && value !== "0" && Boolean(value); } function loadEnvironmentVariable(key) { var _a; if (typeof process !== "undefined" && process.env) { const rawValue = (_a = process.env[key]) !== null && _a !== void 0 ? _a : process.env[key.toLowerCase()]; exports.environmentCache.set(key, rawValue); } } //# sourceMappingURL=configuration.js.map