deno.land / x / domain@v0.1.0 / mod.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import domains from "./domains.ts";
export interface DomainInfo { /** name of the domain in English */ name: string; xn: string; type: | "generic" | "country-code" | "sponsored" | "infrastructure" | "generic-restricted" | "test"; manager: string;}
/** * Check if the domain is valid. * @param domain */export function isValid(domain: string): boolean { return domains.findIndex((x) => x[0] === domain) !== -1;}
/** * get an array with all the domains supported */export function getAllDomains(): string[] { return domains.map((x) => x[0]);}
export function getDomainInfo(domain: string): DomainInfo | null { for (let x of domains) { if (x[0] === domain) { return { name: x[0], xn: x[1], type: x[2], manager: x[3], }; } }
return null;}
domain

Version Info

Tagged at
3 years ago

External Dependencies

No external dependencies 🎉