Fix lint
This commit is contained in:
parent
d97a12b718
commit
b3a5fd3cfb
1 changed files with 24 additions and 21 deletions
|
@ -25,31 +25,34 @@ const FALLBACK_DOMAINS = [
|
||||||
async function main() {
|
async function main() {
|
||||||
const config = await Promise.all(
|
const config = await Promise.all(
|
||||||
FALLBACK_DOMAINS.sort().map(async domain => {
|
FALLBACK_DOMAINS.sort().map(async domain => {
|
||||||
|
const ipv4endpoints = (await resolve4(domain)).map(a => ({
|
||||||
|
family: 'ipv4',
|
||||||
|
address: a,
|
||||||
|
}));
|
||||||
|
|
||||||
const ipv4endpoints = (await resolve4(domain))
|
const ipv6endpoints = (await resolve6(domain)).map(a => ({
|
||||||
.map(a => ({"family": "ipv4", "address": a}))
|
family: 'ipv6',
|
||||||
|
address: a,
|
||||||
const ipv6endpoints = (await resolve6(domain))
|
}));
|
||||||
.map(a => ({"family": "ipv6", "address": a}))
|
|
||||||
|
|
||||||
const endpoints = [...ipv4endpoints, ...ipv6endpoints]
|
const endpoints = [...ipv4endpoints, ...ipv6endpoints]
|
||||||
.filter(isNotNil)
|
.filter(isNotNil)
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
if (a.family < b.family) {
|
if (a.family < b.family) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (a.family > b.family) {
|
if (a.family > b.family) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a.address < b.address) {
|
if (a.address < b.address) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (a.address > b.address) {
|
if (a.address > b.address) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
})
|
});
|
||||||
|
|
||||||
return { domain, endpoints };
|
return { domain, endpoints };
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue