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

Function parsePositiveInt

packages/agent-core/src/config/env-model.ts:41–46  ·  view source on GitHub ↗
(raw: string, varName: string)

Source from the content-addressed store, hash-verified

39}
40
41function parsePositiveInt(raw: string, varName: string): number {
42 if (!/^\d+$/.test(raw) || Number(raw) <= 0) {
43 fail(`${varName} must be a positive integer, got "${raw}".`);
44 }
45 return Number(raw);
46}
47
48function parseProviderType(raw: string | undefined): ProviderType {
49 if (raw === undefined) return 'kimi';

Callers 1

applyEnvModelConfigFunction · 0.70

Calls 1

failFunction · 0.70

Tested by

no test coverage detected