(value, fallback)
| 538 | } |
| 539 | |
| 540 | function parsePort(value, fallback) { |
| 541 | if (value == null || value === "") { |
| 542 | return fallback; |
| 543 | } |
| 544 | |
| 545 | const parsed = Number.parseInt(value, 10); |
| 546 | if (!Number.isInteger(parsed) || parsed <= 0) { |
| 547 | throw new Error(`Invalid port: ${value}`); |
| 548 | } |
| 549 | |
| 550 | return parsed; |
| 551 | } |
| 552 | |
| 553 | /** |
| 554 | * Build safe dev configuration (synchronous version). |
no outgoing calls
no test coverage detected