(raw: string | undefined)
| 107 | } |
| 108 | |
| 109 | function parseIdleGraceMs(raw: string | undefined): number { |
| 110 | if (raw === undefined) return DEFAULT_IDLE_GRACE_MS; |
| 111 | const n = Number.parseInt(raw, 10); |
| 112 | if (!Number.isFinite(n) || n < 0) { |
| 113 | throw new Error(`error: invalid --idle-grace-ms value: ${raw}`); |
| 114 | } |
| 115 | return n; |
| 116 | } |
| 117 | |
| 118 | export function parsePort(raw: string | undefined, label: string, fallback: number): number { |
| 119 | if (raw === undefined) return fallback; |
no outgoing calls
no test coverage detected