(value, fallback)
| 519 | } |
| 520 | |
| 521 | function parsePort(value, fallback) { |
| 522 | if (value == null || value === "") { |
| 523 | return fallback; |
| 524 | } |
| 525 | |
| 526 | const parsed = Number.parseInt(value, 10); |
| 527 | if (!Number.isInteger(parsed) || parsed <= 0) { |
| 528 | throw new Error(`Invalid port: ${value}`); |
| 529 | } |
| 530 | |
| 531 | return parsed; |
| 532 | } |
| 533 | |
| 534 | /** |
| 535 | * Build safe dev configuration (synchronous version). |
no outgoing calls
no test coverage detected