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

Function parseBooleanEnv

packages/agent-core/src/config/resolve.ts:22–28  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

20}
21
22export function parseBooleanEnv(value: string | undefined): boolean | undefined {
23 const normalized = value?.trim().toLowerCase();
24 if (normalized === undefined || normalized.length === 0) return undefined;
25 if (TRUE_BOOLEAN_ENV_VALUES.has(normalized)) return true;
26 if (FALSE_BOOLEAN_ENV_VALUES.has(normalized)) return false;
27 return undefined;
28}
29
30/**
31 * Parse a floating-point environment value (e.g. `KIMI_MODEL_TEMPERATURE`).

Callers 3

configs.test.tsFile · 0.90
explainMethod · 0.90
parseBooleanVarFunction · 0.90

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected