(value: string)
| 4 | import { UsageError } from './errors.js'; |
| 5 | |
| 6 | export 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 | |
| 15 | export function parseDoctorFormat(value: string): DoctorFormat { |
| 16 | return parseEnumValue(value, DOCTOR_FORMATS, 'doctor format'); |
nothing calls this directly
no outgoing calls
no test coverage detected