fix(ci/config): Improve CI workflows, update project configuration, and clean up code formatting
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartnetwork',
|
||||
version: '3.0.3',
|
||||
version: '3.0.4',
|
||||
description: 'A toolkit for network diagnostics including speed tests, port availability checks, and more.'
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ export class CloudflareSpeed {
|
||||
},
|
||||
(error) => {
|
||||
console.log(`Error: ${error}`);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ export class CloudflareSpeed {
|
||||
},
|
||||
(error) => {
|
||||
console.log(`Error: ${error}`);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ export class CloudflareSpeed {
|
||||
},
|
||||
(error) => {
|
||||
console.log(`Error: ${error}`);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ export class CloudflareSpeed {
|
||||
req.on('error', (err) => {
|
||||
reject(err);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
req.end();
|
||||
|
@ -16,7 +16,10 @@ export class SmartNetwork {
|
||||
return test;
|
||||
}
|
||||
|
||||
public async ping(hostArg: string, timeoutArg: number = 500): Promise<ReturnType<typeof plugins.smartping.Smartping.prototype.ping>> {
|
||||
public async ping(
|
||||
hostArg: string,
|
||||
timeoutArg: number = 500,
|
||||
): Promise<ReturnType<typeof plugins.smartping.Smartping.prototype.ping>> {
|
||||
const smartpingInstance = new plugins.smartping.Smartping();
|
||||
const pingResult = await smartpingInstance.ping(hostArg, timeoutArg);
|
||||
return pingResult;
|
||||
@ -120,18 +123,22 @@ export class SmartNetwork {
|
||||
|
||||
public async getPublicIps() {
|
||||
return {
|
||||
v4: await plugins.publicIp.publicIpv4({
|
||||
timeout: 1000,
|
||||
onlyHttps: true,
|
||||
}).catch(async (err) => {
|
||||
return null
|
||||
}),
|
||||
v6: await plugins.publicIp.publicIpv6({
|
||||
timeout: 1000,
|
||||
onlyHttps: true,
|
||||
}).catch(async (err) => {
|
||||
return null
|
||||
})
|
||||
v4: await plugins.publicIp
|
||||
.publicIpv4({
|
||||
timeout: 1000,
|
||||
onlyHttps: true,
|
||||
})
|
||||
.catch(async (err) => {
|
||||
return null;
|
||||
}),
|
||||
v6: await plugins.publicIp
|
||||
.publicIpv6({
|
||||
timeout: 1000,
|
||||
onlyHttps: true,
|
||||
})
|
||||
.catch(async (err) => {
|
||||
return null;
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user