MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / normalizeBasePath

Function normalizeBasePath

src/utils/base-path.ts:3–9  ·  view source on GitHub ↗
(value?: string | null)

Source from the content-addressed store, hash-verified

1const BASE_PATH_WINDOW_KEY = "__AGENT_CANVAS_BASE_PATH__";
2
3function normalizeBasePath(value?: string | null): string {
4 const raw = value?.trim();
5 if (!raw || raw === "/") return "";
6
7 const withLeadingSlash = raw.startsWith("/") ? raw : `/${raw}`;
8 return withLeadingSlash.replace(/\/+$/, "");
9}
10
11export function getAgentCanvasBasePath(): string {
12 const envPath = normalizeBasePath(import.meta.env.VITE_BASE_PATH);

Callers 1

getAgentCanvasBasePathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected