(value?: string | null)
| 1 | const BASE_PATH_WINDOW_KEY = "__AGENT_CANVAS_BASE_PATH__"; |
| 2 | |
| 3 | function 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 | |
| 11 | export function getAgentCanvasBasePath(): string { |
| 12 | const envPath = normalizeBasePath(import.meta.env.VITE_BASE_PATH); |
no outgoing calls
no test coverage detected