(origin: string)
| 2887 | }); |
| 2888 | |
| 2889 | const portFromOrigin = (origin: string): number | null => { |
| 2890 | try { |
| 2891 | const url = new URL(origin); |
| 2892 | if (!url.port) return url.protocol === "https:" ? 443 : 80; |
| 2893 | const port = Number.parseInt(url.port, 10); |
| 2894 | return Number.isInteger(port) && port > 0 ? port : null; |
| 2895 | } catch { |
| 2896 | return null; |
| 2897 | } |
| 2898 | }; |
| 2899 | |
| 2900 | const servicePortOption = () => |
| 2901 | Options.integer("port") |
no outgoing calls
no test coverage detected