MCPcopy Index your code
hub / github.com/anomalyco/opencode / normalizeServerUrl

Function normalizeServerUrl

packages/opencode/src/account/url.ts:1–8  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

1export const normalizeServerUrl = (input: string): string => {
2 const url = new URL(input)
3 url.search = ""
4 url.hash = ""
5
6 const pathname = url.pathname.replace(/\/+$/, "")
7 return pathname.length === 0 ? url.origin : `${url.origin}${pathname}`
8}

Callers 2

repo.tsFile · 0.90
account.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected