MCPcopy Index your code
hub / github.com/coder/mux / stripTrailingSlash

Function stripTrailingSlash

src/common/appProxyBasePath.ts:7–9  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

5}
6
7function stripTrailingSlash(pathname: string): string {
8 return pathname.length > 1 && pathname.endsWith("/") ? pathname.slice(0, -1) : pathname;
9}
10
11export function getAppProxyBasePathFromPathname(pathname: string): string | null {
12 if (hasUnsafeLeadingDoubleSlash(pathname)) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected