MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / normalizeUrl

Function normalizeUrl

src/utils/github/copilotApi.ts:8–20  ·  view source on GitHub ↗
(url: string | undefined)

Source from the content-addressed store, hash-verified

6let cachedCopilotApiUrl: string | null | undefined
7
8function 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
22function getEnvCopilotApiUrl(): string | undefined {
23 return (

Callers 2

getEnvCopilotApiUrlFunction · 0.70
getGhCliCopilotApiUrlFunction · 0.70

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected