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;AA9GD,wCA8GC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport process from 'process';\nimport { InternalError } from './InternalError';\n\n/**\n * A process environment variable name and its value. Used by {@link EnvironmentMap}.\n * @public\n */\nexport interface IEnvironmentEntry {\n /**\n * The name of the environment variable.\n */\n name: string;\n\n /**\n * The value of the environment variable.\n */\n value: string;\n}\n\n/**\n * A map data structure that stores process environment variables. On Windows\n * operating system, the variable names are case-insensitive.\n * @public\n */\nexport class EnvironmentMap {\n private readonly _map: Map<string, IEnvironmentEntry> = new Map();\n\n /**\n * Whether the environment variable names are case-sensitive.\n *\n * @remarks\n * On Windows operating system, environment variables are case-insensitive.\n * The map will preserve the variable name casing from the most recent assignment operation.\n */\n public readonly caseSensitive: boolean;\n\n public constructor(environmentObject: Record<string, string | undefined> = {}) {\n // This property helps catch a mistake where an instance of `EnvironmentMap` is accidentally passed to\n // a function that expects a `Record<string, string>` (as would be used with the `process.env` API).\n // The property getter will throw an exception if that function tries to enumerate the object values.\n Object.defineProperty(this, '_sanityCheck', {\n enumerable: true,\n get: function () {\n throw new InternalError('Attempt to read EnvironmentMap class as an object');\n }\n });\n\n this.caseSensitive = process.platform !== 'win32';\n this.mergeFromObject(environmentObject);\n }\n\n /**\n * Clears all entries, resulting in an empty map.\n */\n public clear()
|