(value, fallback)
| 603 | } |
| 604 | |
| 605 | function parsePort(value, fallback) { |
| 606 | if (value == null || value === "") { |
| 607 | return fallback; |
| 608 | } |
| 609 | |
| 610 | const parsed = Number.parseInt(value, 10); |
| 611 | if (!Number.isInteger(parsed) || parsed <= 0) { |
| 612 | throw new Error(`Invalid port: ${value}`); |
| 613 | } |
| 614 | |
| 615 | return parsed; |
| 616 | } |
| 617 | |
| 618 | /** |
| 619 | * Build safe dev configuration (synchronous version). |
no outgoing calls
no test coverage detected