Files
InvokeAI/docs/src/lib/base-path.ts
2026-04-18 20:37:32 -04:00

7 lines
236 B
TypeScript

export const withBase = (path: string, baseUrl: string) => {
const normalizedBase = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
const normalizedPath = path.replace(/^\//, '');
return `${normalizedBase}${normalizedPath}`;
};