(value: string | number | undefined)
| 30 | } |
| 31 | |
| 32 | function parsePort(value: string | number | undefined): number { |
| 33 | if (value === undefined || value === "") return 7676; |
| 34 | |
| 35 | const port = Number(value); |
| 36 | if (!Number.isInteger(port) || port < 1 || port > 65535) { |
| 37 | throw new Error(`Invalid PORT: ${value}`); |
| 38 | } |
| 39 | |
| 40 | return port; |
| 41 | } |
| 42 | |
| 43 | function parseAllowedRoots(value: string | string[] | undefined): string[] { |
| 44 | if (Array.isArray(value)) { |