MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / isBypassed

Function isBypassed

out/cli.cjs:76244–76270  ·  view source on GitHub ↗
(uri, noProxyList, bypassedMap)

Source from the content-addressed store, hash-verified

76242 if (!process) {
76243 return void 0;
76244 }
76245 const httpsProxy = getEnvironmentValue(HTTPS_PROXY);
76246 const allProxy = getEnvironmentValue(ALL_PROXY);
76247 const httpProxy = getEnvironmentValue(HTTP_PROXY);
76248 return httpsProxy || allProxy || httpProxy;
76249}
76250function isBypassed(uri, noProxyList, bypassedMap) {
76251 if (noProxyList.length === 0) {
76252 return false;
76253 }
76254 const host = new URL(uri).hostname;
76255 if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) {
76256 return bypassedMap.get(host);
76257 }
76258 let isBypassedFlag = false;
76259 for (const pattern of noProxyList) {
76260 if (pattern[0] === ".") {
76261 if (host.endsWith(pattern)) {
76262 isBypassedFlag = true;
76263 } else {
76264 if (host.length === pattern.length - 1 && host === pattern.slice(1)) {
76265 isBypassedFlag = true;
76266 }
76267 }
76268 } else {
76269 if (host === pattern) {
76270 isBypassedFlag = true;
76271 }
76272 }
76273 }

Callers 1

sendRequestFunction · 0.85

Calls 5

endsWithMethod · 0.80
hasMethod · 0.45
getMethod · 0.45
sliceMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…