fix(core): update

This commit is contained in:
2022-02-17 00:18:23 +01:00
parent 695d047200
commit 95c3314400
9 changed files with 17 additions and 31 deletions

View File

@ -1 +1 @@
export * from './smartnetwork.classes.smartnetwork';
export * from './smartnetwork.classes.smartnetwork';

View File

@ -106,7 +106,7 @@ export class CloudflareSpeed {
public async fetchServerLocations(): Promise<{ [key: string]: string }> {
const res = JSON.parse(await this.get('speed.cloudflare.com', '/locations'));
return res.reduce((data: any, optionsArg: { iata: string, city: string}) => {
return res.reduce((data: any, optionsArg: { iata: string; city: string }) => {
// Bypass prettier "no-assign-param" rules
const data1 = data;
@ -172,7 +172,7 @@ export class CloudflareSpeed {
public async request(options: plugins.https.RequestOptions, data = ''): Promise<number[]> {
let started: number;
let dnsLookup: number;
let tcpHandshake : number;
let tcpHandshake: number;
let sslHandshake: number;
let ttfb: number;
let ended: number;

View File

@ -17,7 +17,7 @@ export class SmartNetwork {
}
public async ping(hostArg: string, timeoutArg: number = 500): Promise<boolean> {
if (process.getuid() !== 0 ) {
if (process.getuid() !== 0) {
console.log('icmp not allowed for nonroot!');
return;
}

View File

@ -13,7 +13,7 @@ export { smartpromise, smartstring };
// @third party scope
const isopen = require('isopen');
const icmp = require('icmp');
const icmp = require('icmp');
import * as publicIp from 'public-ip';
import * as systeminformation from 'systeminformation';