fix: whois check
This commit is contained in:
+6
-1
@@ -4,7 +4,12 @@ export async function isDomainAvailable(domain: string): Promise<boolean> {
|
|||||||
`https://whois.klemek.fr/api/lookup/${domain}`,
|
`https://whois.klemek.fr/api/lookup/${domain}`,
|
||||||
);
|
);
|
||||||
const content = await response.json();
|
const content = await response.json();
|
||||||
return content?.data?.nameservers?.length === 0;
|
for (const event of content?.data?.events ?? []) {
|
||||||
|
if (event?.eventAction === "registration" && event?.eventDate === "") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user