mirror of
https://github.com/younesaassila/ttv-lol-pro.git
synced 2025-05-29 13:00:19 +02:00
More compact code
This commit is contained in:
parent
c891597ac7
commit
f53fda0367
@ -1,7 +1,6 @@
|
||||
export default function getHostFromUrl(url: string) {
|
||||
try {
|
||||
const Url = new URL(url);
|
||||
return Url.host;
|
||||
return new URL(url).host;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
export default function toAbsoluteUrl(url: string): string {
|
||||
try {
|
||||
const Url = new URL(url, location.href);
|
||||
return Url.href;
|
||||
return new URL(url, location.href).href;
|
||||
} catch {
|
||||
return url;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user