MCPcopy Index your code
hub / github.com/cameri/nostream / validateEnvPair

Function validateEnvPair

src/cli/utils/env-config.ts:137–151  ·  view source on GitHub ↗
(key: string, value: string)

Source from the content-addressed store, hash-verified

135}
136
137export const validateEnvPair = (key: string, value: string): string | undefined => {
138 if (!isSupportedEnvKey(key)) {
139 return `${key} is not a supported environment setting`
140 }
141
142 if (INTEGER_KEYS.has(key) || RR_INTEGER_KEY_REGEX.test(key)) {
143 return validateInteger(key, value)
144 }
145
146 if (BOOLEAN_KEYS.has(key)) {
147 return validateBoolean(key, value)
148 }
149
150 return undefined
151}
152
153export const readEnvValues = (): Record<string, string> => {
154 const { parsed } = parseEnvFile()

Callers 3

commands.spec.tsFile · 0.90
runConfigEnvSetFunction · 0.90
validateEnvValuesFunction · 0.85

Calls 3

isSupportedEnvKeyFunction · 0.85
validateIntegerFunction · 0.85
validateBooleanFunction · 0.85

Tested by

no test coverage detected