fix: blacklist and tld-list link
This commit is contained in:
+19
-2
@@ -142,8 +142,25 @@ onMounted(() => {
|
|||||||
<span class="loading loading-dots loading-xs"></span>
|
<span class="loading loading-dots loading-xs"></span>
|
||||||
</p>
|
</p>
|
||||||
<div v-else-if="state === State.Ready && domainAvailable" class="py-6">
|
<div v-else-if="state === State.Ready && domainAvailable" class="py-6">
|
||||||
<span v-if="lang === 'french'">Ce domaine semble disponible !</span>
|
<span v-if="lang === 'french'"
|
||||||
<span v-else>This domain seems available!</span>
|
>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>
|
||||||
<div v-else-if="state === State.Ready && !domainAvailable" class="py-6">
|
<div v-else-if="state === State.Ready && !domainAvailable" class="py-6">
|
||||||
<span v-if="lang === 'french'">Ce domaine n'est pas disponible.</span>
|
<span v-if="lang === 'french'">Ce domaine n'est pas disponible.</span>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+4
-10
@@ -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[]> {
|
export async function getTLDList(): Promise<string[]> {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
@@ -7,10 +9,7 @@ export async function getTLDList(): Promise<string[]> {
|
|||||||
const content = await response.text();
|
const content = await response.text();
|
||||||
const tldList: string[] = [];
|
const tldList: string[] = [];
|
||||||
// @ts-expect-error - not empty string
|
// @ts-expect-error - not empty string
|
||||||
content
|
content.split("\n").forEach((line) => {
|
||||||
.split("// ===END ICANN DOMAINS===")[0]
|
|
||||||
.split("\n")
|
|
||||||
.forEach((line) => {
|
|
||||||
line = line.trim().toLowerCase();
|
line = line.trim().toLowerCase();
|
||||||
if (
|
if (
|
||||||
line.length &&
|
line.length &&
|
||||||
@@ -21,11 +20,6 @@ export async function getTLDList(): Promise<string[]> {
|
|||||||
line.replace(/[^\x20-\x7F]/g, "") === line &&
|
line.replace(/[^\x20-\x7F]/g, "") === line &&
|
||||||
!BLACKLIST.includes(line)
|
!BLACKLIST.includes(line)
|
||||||
) {
|
) {
|
||||||
// tldList.forEach((other) => {
|
|
||||||
// if (line.endsWith(`.${other}`)) {
|
|
||||||
// tldList.splice(tldList.indexOf(other), 1);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
tldList.push(line);
|
tldList.push(line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user