🎨 Unified code style

This commit is contained in:
Tw93
2023-06-24 20:17:52 +08:00
parent 07938f02f4
commit 00c01a9638
23 changed files with 107 additions and 117 deletions

5
bin/utils/ip.ts vendored
View File

@@ -13,13 +13,13 @@ const ping = async (host: string) => {
// Prevent timeouts from affecting user experience.
const requestPromise = new Promise<number>((resolve, reject) => {
const req = http.get(`http://${ip.address}`, (res) => {
const req = http.get(`http://${ip.address}`, res => {
const delay = new Date().getTime() - start.getTime();
res.resume();
resolve(delay);
});
req.on('error', (err) => {
req.on('error', err => {
reject(err);
});
});
@@ -33,7 +33,6 @@ const ping = async (host: string) => {
return Promise.race([requestPromise, timeoutPromise]);
};
async function isChinaDomain(domain: string): Promise<boolean> {
try {
const [ip] = await resolve(domain);