@electron/get
Advanced tools
Comparing version 1.13.1 to 1.14.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const debug = require("debug"); | ||
const utils_1 = require("./utils"); | ||
const d = debug('@electron/get:proxy'); | ||
@@ -13,2 +14,7 @@ /** | ||
if (MAJOR_NODEJS_VERSION >= 10) { | ||
// See: https://github.com/electron/get/pull/214#discussion_r798845713 | ||
const env = utils_1.getEnv('GLOBAL_AGENT_'); | ||
process.env.GLOBAL_AGENT_HTTP_PROXY = env('HTTP_PROXY'); | ||
process.env.GLOBAL_AGENT_HTTPS_PROXY = env('HTTPS_PROXY'); | ||
process.env.GLOBAL_AGENT_NO_PROXY = env('NO_PROXY'); | ||
// `global-agent` works with Node.js v10 and above. | ||
@@ -15,0 +21,0 @@ require('global-agent').bootstrap(); |
@@ -20,1 +20,6 @@ export declare function withTempDirectoryIn<T>(parentDirectory: string | undefined, fn: (directory: string) => Promise<T>): Promise<T>; | ||
export declare function isOfficialLinuxIA32Download(platform: string, arch: string, version: string, mirrorOptions?: object): boolean; | ||
/** | ||
* Find the value of a environment variable which may or may not have the | ||
* prefix, in a case-insensitive manner. | ||
*/ | ||
export declare function getEnv(prefix?: string): (name: string) => string | undefined; |
@@ -83,2 +83,18 @@ "use strict"; | ||
exports.isOfficialLinuxIA32Download = isOfficialLinuxIA32Download; | ||
/** | ||
* Find the value of a environment variable which may or may not have the | ||
* prefix, in a case-insensitive manner. | ||
*/ | ||
function getEnv(prefix = '') { | ||
const envsLowerCase = {}; | ||
for (const envKey in process.env) { | ||
envsLowerCase[envKey.toLowerCase()] = process.env[envKey]; | ||
} | ||
return (name) => { | ||
return (envsLowerCase[`${prefix}${name}`.toLowerCase()] || | ||
envsLowerCase[name.toLowerCase()] || | ||
undefined); | ||
}; | ||
} | ||
exports.getEnv = getEnv; | ||
//# sourceMappingURL=utils.js.map |
import * as debug from 'debug'; | ||
import { getEnv } from './utils'; | ||
const d = debug('@electron/get:proxy'); | ||
@@ -11,2 +12,7 @@ /** | ||
if (MAJOR_NODEJS_VERSION >= 10) { | ||
// See: https://github.com/electron/get/pull/214#discussion_r798845713 | ||
const env = getEnv('GLOBAL_AGENT_'); | ||
process.env.GLOBAL_AGENT_HTTP_PROXY = env('HTTP_PROXY'); | ||
process.env.GLOBAL_AGENT_HTTPS_PROXY = env('HTTPS_PROXY'); | ||
process.env.GLOBAL_AGENT_NO_PROXY = env('NO_PROXY'); | ||
// `global-agent` works with Node.js v10 and above. | ||
@@ -13,0 +19,0 @@ require('global-agent').bootstrap(); |
@@ -20,1 +20,6 @@ export declare function withTempDirectoryIn<T>(parentDirectory: string | undefined, fn: (directory: string) => Promise<T>): Promise<T>; | ||
export declare function isOfficialLinuxIA32Download(platform: string, arch: string, version: string, mirrorOptions?: object): boolean; | ||
/** | ||
* Find the value of a environment variable which may or may not have the | ||
* prefix, in a case-insensitive manner. | ||
*/ | ||
export declare function getEnv(prefix?: string): (name: string) => string | undefined; |
@@ -73,2 +73,17 @@ import * as childProcess from 'child_process'; | ||
} | ||
/** | ||
* Find the value of a environment variable which may or may not have the | ||
* prefix, in a case-insensitive manner. | ||
*/ | ||
export function getEnv(prefix = '') { | ||
const envsLowerCase = {}; | ||
for (const envKey in process.env) { | ||
envsLowerCase[envKey.toLowerCase()] = process.env[envKey]; | ||
} | ||
return (name) => { | ||
return (envsLowerCase[`${prefix}${name}`.toLowerCase()] || | ||
envsLowerCase[name.toLowerCase()] || | ||
undefined); | ||
}; | ||
} | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@electron/get", | ||
"version": "1.13.1", | ||
"version": "1.14.0", | ||
"description": "Utility for downloading artifacts from different versions of Electron", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90976
1299
33