MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / pick

Function pick

scripts/guardian/shared.ts:116–124  ·  view source on GitHub ↗
(name: PortName)

Source from the content-addressed store, hash-verified

114 file: Partial<Record<PortName, number>>,
115): PortConfig {
116 const pick = (name: PortName): PortChoice => {
117 const envRaw = env[ENV_KEYS[name]]
118 if (envRaw !== undefined && envRaw !== '') {
119 return { value: parsePort(envRaw, ENV_KEYS[name]), source: 'env' }
120 }
121 const fromFile = file[name]
122 if (fromFile !== undefined) return { value: fromFile, source: 'file' }
123 return { value: PORT_DEFAULTS[name], source: 'default' }
124 }
125 return { web: pick('web'), mcp: pick('mcp'), uta: pick('uta'), ui: pick('ui') }
126}
127

Callers 1

resolvePortConfigFunction · 0.70

Calls 1

parsePortFunction · 0.70

Tested by

no test coverage detected