Function
parseCapacityValue
(raw: string | undefined)
Source from the content-addressed store, hash-verified
| 1727 | } |
| 1728 | |
| 1729 | function parseCapacityValue(raw: string | undefined): number | string { |
| 1730 | const n = raw === undefined ? NaN : parseInt(raw, 10) |
| 1731 | if (isNaN(n) || n < 1) { |
| 1732 | return `--capacity requires a positive integer (got: ${raw ?? '<missing>'})` |
| 1733 | } |
| 1734 | return n |
| 1735 | } |
| 1736 | |
| 1737 | export function parseArgs(args: string[]): ParsedArgs { |
| 1738 | let verbose = false |
Tested by
no test coverage detected