MCPcopy Create free account
hub / github.com/aaronnat23/disp8ch / parseIntConfigValue

Function parseIntConfigValue

scripts/cli.ts:415–426  ·  view source on GitHub ↗
(value: string, key: string, min: number, max?: number)

Source from the content-addressed store, hash-verified

413}
414
415function parseIntConfigValue(value: string, key: string, min: number, max?: number): number {
416 const parsed = parseInt(value, 10);
417 if (!Number.isFinite(parsed) || parsed < min || (max !== undefined && parsed > max)) {
418 console.error(
419 max === undefined
420 ? `${key} must be >= ${min}`
421 : `${key} must be between ${min} and ${max}`
422 );
423 process.exit(1);
424 }
425 return parsed;
426}
427
428function parseNumberConfigValue(value: string, key: string, min: number, max: number): number {
429 const parsed = Number(value);

Callers 2

parseOptionalIntFunction · 0.85
configSetCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected