mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-31 06:59:07 +02:00
♻️ Remove unused and update utils (#1786)
This commit is contained in:
parent
7ab25c68de
commit
40d6a51245
4 changed files with 9 additions and 67 deletions
|
@ -15,7 +15,10 @@ function joinPath(baseUrl: string, subpath = "") {
|
|||
return baseUrl;
|
||||
}
|
||||
|
||||
export function absoluteUrl(subpath = "", query: Record<string, string> = {}) {
|
||||
export function absoluteUrl(
|
||||
subpath = "",
|
||||
query: { [key: string]: string | undefined } = {},
|
||||
) {
|
||||
const baseUrl =
|
||||
process.env.NEXT_PUBLIC_BASE_URL ??
|
||||
getVercelUrl() ??
|
||||
|
@ -23,10 +26,11 @@ export function absoluteUrl(subpath = "", query: Record<string, string> = {}) {
|
|||
|
||||
const url = new URL(subpath, baseUrl);
|
||||
|
||||
// biome-ignore lint/complexity/noForEach: Fix this later
|
||||
Object.entries(query).forEach(([key, value]) => {
|
||||
url.searchParams.set(key, value);
|
||||
});
|
||||
for (const [key, value] of Object.entries(query)) {
|
||||
if (value) {
|
||||
url.searchParams.set(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
const urlString = url.href;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue