Refactor isLocalhost function for readability

Fix lint
This commit is contained in:
Sicarius
2026-03-02 11:06:18 -06:00
committed by GitHub
parent 49eae4e8ab
commit 7b95e89e82

View File

@@ -4,10 +4,10 @@ const DANGEROUS_SCHEMES = ["javascript:", "data:", "vbscript:"];
function isLocalhost(hostname: string): boolean {
return (
hostname === "localhost"
|| hostname === "127.0.0.1"
|| hostname === "[::1]"
|| hostname.endsWith(".localhost")
hostname === "localhost" ||
hostname === "127.0.0.1" ||
hostname === "[::1]" ||
hostname.endsWith(".localhost")
);
}