mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-16 04:20:44 +00:00
12 lines
338 B
TypeScript
12 lines
338 B
TypeScript
export function buildProfileQuery(profile?: string): string {
|
|
return profile ? `?profile=${encodeURIComponent(profile)}` : "";
|
|
}
|
|
|
|
export function withBaseUrl(baseUrl: string | undefined, path: string): string {
|
|
const trimmed = baseUrl?.trim();
|
|
if (!trimmed) {
|
|
return path;
|
|
}
|
|
return `${trimmed.replace(/\/$/, "")}${path}`;
|
|
}
|