decentralised sync engine

refactor: add exception to domain checking for localhost

serenity c1b967a8 5e139ebd

Changed files
+4 -1
src
lib
utils
+4 -1
src/lib/utils/domains.ts
···
export const isDomain = (str: string) => {
try {
const url = new URL(str.includes("://") ? str : `https://${str}`);
-
return url.hostname.includes(".") && !url.hostname.startsWith(".");
+
return (
+
(url.hostname.includes(".") && !url.hostname.startsWith(".")) ||
+
url.hostname === "localhost"
+
);
} catch {
return false;
}