(url: string | undefined)
| 6 | let cachedCopilotApiUrl: string | null | undefined |
| 7 | |
| 8 | function normalizeUrl(url: string | undefined): string | undefined { |
| 9 | if (!url) { |
| 10 | return undefined |
| 11 | } |
| 12 | |
| 13 | try { |
| 14 | const normalized = new URL(url) |
| 15 | normalized.pathname = normalized.pathname.replace(/\/+$/, '') || '/' |
| 16 | return normalized.toString().replace(/\/$/, '') |
| 17 | } catch { |
| 18 | return undefined |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | function getEnvCopilotApiUrl(): string | undefined { |
| 23 | return ( |
no test coverage detected