MCPcopy Index your code
hub / github.com/coder/code-server / normalize

Function normalize

src/common/util.ts:24–26  ·  view source on GitHub ↗
(url: string, keepTrailing = false)

Source from the content-addressed store, hash-verified

22 * file system paths, not URLs.
23 */
24export const normalize = (url: string, keepTrailing = false): string => {
25 return url.replace(/\/\/+/g, "/").replace(/\/+$/, keepTrailing ? "/" : "")
26}
27
28// TODO: Might make sense to add Error handling to the logger itself.
29export function logError(logger: { error: (msg: string) => void }, prefix: string, err: unknown): void {

Callers 5

navigateMethod · 0.90
relativeRootFunction · 0.90
constructRedirectPathFunction · 0.90
getCookieOptionsFunction · 0.90
selfFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected