(value, fallback)
| 508 | } |
| 509 | |
| 510 | function parsePort(value, fallback) { |
| 511 | if (value == null || value === "") { |
| 512 | return fallback; |
| 513 | } |
| 514 | |
| 515 | const parsed = Number.parseInt(value, 10); |
| 516 | if (!Number.isInteger(parsed) || parsed <= 0) { |
| 517 | throw new Error(`Invalid port: ${value}`); |
| 518 | } |
| 519 | |
| 520 | return parsed; |
| 521 | } |
| 522 | |
| 523 | /** |
| 524 | * Build safe dev configuration (synchronous version). |
no outgoing calls
no test coverage detected