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.

rearrange

Steven Tey8154e6fc2005
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index 2a036e8955..cfbaf05026 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -252,11 +252,12 @@ export function processKey(key: string) {
}
// remove all leading and trailing slashes from key
key = key.replace(/^\/+|\/+$/g, "");
- // replace all special characters
- key = key.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
if (key.length === 0) {
return null;
}
+ // replace all special characters
+ key = key.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
+
return key;
}