MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / parsePositiveInteger

Function parsePositiveInteger

cli/src/utils/options.ts:6–13  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

4import { UsageError } from './errors.js';
5
6export function parsePositiveInteger(value: string): number {
7 const parsed = Number.parseInt(value, 10);
8 if (!Number.isInteger(parsed) || parsed <= 0) {
9 throw new InvalidArgumentError('Expected a positive integer.');
10 }
11
12 return parsed;
13}
14
15export function parseDoctorFormat(value: string): DoctorFormat {
16 return parseEnumValue(value, DOCTOR_FORMATS, 'doctor format');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected