Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix getPrettyUrl

Steven Tey3350a590f805
diff --git a/packages/utils/src/functions/urls.ts b/packages/utils/src/functions/urls.ts
index 4f14e965eb..64c7a99d77 100644
--- a/packages/utils/src/functions/urls.ts
+++ b/packages/utils/src/functions/urls.ts
@@ -106,7 +106,8 @@ export const getUrlWithoutUTMParams = (url: string) => {
}
};
-export const getPrettyUrl = (url: string) => {
+export const getPrettyUrl = (url?: string | null) => {
+ if (!url) return "";
// remove protocol (http/https) and www.
// also remove trailing slash
return url