We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 447a861 commit abf912fCopy full SHA for abf912f
1 file changed
lib/url.ts
@@ -2,11 +2,8 @@ import { getEnvOrThrow } from "./runtime.ts";
2
3
export function buildUrl(
4
path: string,
5
- baseUrl: string | undefined = getBaseUrl(),
+ baseUrl: string = getBaseUrl(),
6
): string {
7
- if (!baseUrl) {
8
- return path.startsWith("/") ? path : `/${path}`;
9
- }
10
const normalizedBaseUrl = baseUrl.replace(/\/*$/, "");
11
const normalizedPath = path.replace(/^\/*|\/*$/g, "");
12
return `${normalizedBaseUrl}/${normalizedPath}`;
@@ -20,7 +17,7 @@ export function joinPath(...paths: string[]): string {
20
17
return `/${normalizedPaths}`;
21
18
}
22
19
23
-export function getBaseUrl(): string | undefined {
+export function getBaseUrl(): string {
24
const host = getEnvOrThrow("JET_BREEZE_HOST");
25
const pathPrefix = getEnvOrThrow("JET_BREEZE_PATH_PREFIX");
26
0 commit comments