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) {
|
export default function getHostFromUrl(url: string) {
|
||||||
try {
|
try {
|
||||||
const Url = new URL(url);
|
return new URL(url).host;
|
||||||
return Url.host;
|
|
||||||
} catch {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
export default function toAbsoluteUrl(url: string): string {
|
export default function toAbsoluteUrl(url: string): string {
|
||||||
try {
|
try {
|
||||||
const Url = new URL(url, location.href);
|
return new URL(url, location.href).href;
|
||||||
return Url.href;
|
|
||||||
} catch {
|
} catch {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user