(err: unknown)
| 793 | const RANDOM_PORT_RETRIES = 5; |
| 794 | |
| 795 | function normalizePortError(err: unknown): Extract<PortCheckResult, { available: false }> { |
| 796 | const maybeNodeError = err as NodeJS.ErrnoException | undefined; |
| 797 | return { |
| 798 | available: false, |
| 799 | code: maybeNodeError?.code, |
| 800 | message: maybeNodeError?.message || String(err), |
| 801 | }; |
| 802 | } |
| 803 | |
| 804 | function isOccupiedPort(result: Extract<PortCheckResult, { available: false }>): boolean { |
| 805 | return result.code === 'EADDRINUSE'; |
no outgoing calls
no test coverage detected