fix: blacklist and tld-list link
Lint / Oxlint (push) Successful in 57s
Lint / ESLint (push) Successful in 57s
Deploy / Build (push) Failing after 57s
Lint / TypeScript (push) Failing after 57s
Deploy / Deploy to Stapler (push) Has been skipped

This commit is contained in:
2026-06-16 00:34:56 +02:00
parent de663b2cd9
commit 5b5b170caf
3 changed files with 1322 additions and 25 deletions
+19 -2
View File
@@ -142,8 +142,25 @@ onMounted(() => {
<span class="loading loading-dots loading-xs"></span>
</p>
<div v-else-if="state === State.Ready && domainAvailable" class="py-6">
<span v-if="lang === 'french'">Ce domaine semble disponible !</span>
<span v-else>This domain seems available!</span>
<span v-if="lang === 'french'"
>Ce domaine semble
<a
:href="`https://tld-list.com/fr/tld/${domain?.split('.')[1]}`"
target="_blank"
class="underline"
>disponible</a
>
!</span
>
<span v-else
>This domain seems
<a
:href="`https://tld-list.com/tld/${domain?.split('.')[1]}`"
target="_blank"
class="underline"
>available</a
>!</span
>
</div>
<div v-else-if="state === State.Ready && !domainAvailable" class="py-6">
<span v-if="lang === 'french'">Ce domaine n'est pas disponible.</span>
File diff suppressed because it is too large Load Diff
+17 -23
View File
@@ -1,4 +1,6 @@
const BLACKLIST = ["able", "gle", "pin", "mil"];
import raw_blacklist from "@/data/blacklist.txt";
const BLACKLIST = raw_blacklist.split("\n");
export async function getTLDList(): Promise<string[]> {
const response = await fetch(
@@ -7,27 +9,19 @@ export async function getTLDList(): Promise<string[]> {
const content = await response.text();
const tldList: string[] = [];
// @ts-expect-error - not empty string
content
.split("// ===END ICANN DOMAINS===")[0]
.split("\n")
.forEach((line) => {
line = line.trim().toLowerCase();
if (
line.length &&
!line.startsWith("//") &&
!line.startsWith("*") &&
!line.startsWith("#") &&
!line.startsWith("xn--") &&
line.replace(/[^\x20-\x7F]/g, "") === line &&
!BLACKLIST.includes(line)
) {
// tldList.forEach((other) => {
// if (line.endsWith(`.${other}`)) {
// tldList.splice(tldList.indexOf(other), 1);
// }
// });
tldList.push(line);
}
});
content.split("\n").forEach((line) => {
line = line.trim().toLowerCase();
if (
line.length &&
!line.startsWith("//") &&
!line.startsWith("*") &&
!line.startsWith("#") &&
!line.startsWith("xn--") &&
line.replace(/[^\x20-\x7F]/g, "") === line &&
!BLACKLIST.includes(line)
) {
tldList.push(line);
}
});
return tldList;
}