Update display of combined referrer urls.

This commit is contained in:
Mike Cao 2020-09-15 21:25:51 -07:00
parent f113d0cb34
commit 4ab71c42a6
5 changed files with 17 additions and 8 deletions

View file

@ -2,6 +2,10 @@ export function removeTrailingSlash(url) {
return url && url.length > 1 && url.endsWith('/') ? url.slice(0, -1) : url;
}
export function removeWWW(url) {
return url && url.length > 1 && url.startsWith('www.') ? url.slice(4) : url;
}
export function getDomainName(str) {
try {
return new URL(str).hostname;