renovate/lib/proxy.ts
renovate[bot] 4f59b62da4
chore(deps): update dependency prettier to v2 (#5952)
* chore(deps): update dependency prettier to v2

* Run prettier-fix

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
2020-04-12 18:09:36 +02:00

21 lines
593 B
TypeScript

import {
createGlobalProxyAgent,
ProxyAgentConfigurationType,
} from 'global-agent';
const envVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];
export function bootstrap(): ProxyAgentConfigurationType {
envVars.forEach((envVar) => {
/* istanbul ignore if: env is case-insensitive on windows */
if (
typeof process.env[envVar] === 'undefined' &&
typeof process.env[envVar.toLowerCase()] !== 'undefined'
) {
process.env[envVar] = process.env[envVar.toLowerCase()];
}
});
return createGlobalProxyAgent({
environmentVariableNamespace: '',
});
}