1
2
3
4
5
6
7
8
export const getUrlHostname = (url: string): string => {
try {
return new URL(url).hostname;
}
catch {
return "";
}
};