MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / firstNonBlank

Function firstNonBlank

packages/agent-core/src/utils/proxy.ts:41–47  ·  view source on GitHub ↗

First non-blank value among `keys` (both casings are passed in by callers).

(env: Env, keys: readonly string[])

Source from the content-addressed store, hash-verified

39
40/** First non-blank value among `keys` (both casings are passed in by callers). */
41function firstNonBlank(env: Env, keys: readonly string[]): string | undefined {
42 for (const key of keys) {
43 const value = env[key]?.trim();
44 if (value !== undefined && value.length > 0) return value;
45 }
46 return undefined;
47}
48
49/** The value if it is an HTTP/HTTPS-scheme proxy (not SOCKS), else undefined. */
50function httpSchemeValue(value: string | undefined): string | undefined {

Callers 3

hasHttpProxyFunction · 0.85
resolveHttpProxyUrlsFunction · 0.85
resolveSocksProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected