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

Function getAppProxyBasePathFromPathname

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

Source from the content-addressed store, hash-verified

9}
10
11export function getAppProxyBasePathFromPathname(pathname: string): string | null {
12 if (hasUnsafeLeadingDoubleSlash(pathname)) {
13 return null;
14 }
15
16 const match = APP_PROXY_BASE_PATH_RE.exec(pathname);
17 if (!match) {
18 return null;
19 }
20
21 return stripTrailingSlash(match[0]);
22}
23
24export function stripAppProxyBasePath(pathname: string): {
25 basePath: string | null;

Calls 3

stripTrailingSlashFunction · 0.70
execMethod · 0.65

Tested by

no test coverage detected