frontend/.pnpm-store/v3/files/d1/5faf4add6c6309c6126a4b3d96404738c11bcbdc4c1f048c79645aeef09a772387ad74724e926ec427cf3f62a80c72130f81db1bf5fc736c9e6f6e4ed969a1

23 lines
476 B
Plaintext

var url = require('url');
var override = require('../utils/override');
function inlineRequestFrom(option) {
return override(
/* jshint camelcase: false */
proxyOptionsFrom(process.env.HTTP_PROXY || process.env.http_proxy),
option || {}
);
}
function proxyOptionsFrom(httpProxy) {
return httpProxy ?
{
hostname: url.parse(httpProxy).hostname,
port: parseInt(url.parse(httpProxy).port)
} :
{};
}
module.exports = inlineRequestFrom;