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