summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-19 22:44:18 +0200
committerRory& <root@rory.gay>2026-04-19 22:45:37 +0200
commitc5504878b830ade3f70c94a06a328d605824e548 (patch)
tree07f47e834243d40c9e27ab4446b5a63dbf270294 /src
parenteslint: default-case (diff)
downloadserver-ts-c5504878b830ade3f70c94a06a328d605824e548.tar.xz
eslint: yoda
Diffstat (limited to 'src')
-rw-r--r--src/api/util/utility/passwordStrength.ts4
-rw-r--r--src/util/util/networking/abuseipdb/AbuseIpDbClient.ts4
-rw-r--r--src/util/util/networking/ipdata/IpDataClient.ts2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/api/util/utility/passwordStrength.ts b/src/api/util/utility/passwordStrength.ts

index 7a9d4c5f..041997c9 100644 --- a/src/api/util/utility/passwordStrength.ts +++ b/src/api/util/utility/passwordStrength.ts
@@ -44,12 +44,12 @@ export function checkPassword(password: string): number { } // checks for amount of Numbers - if (password.match(reNUMBER)?.length ?? 0 >= minNumbers - 1) { + if ((password.match(reNUMBER)?.length ?? 0) >= minNumbers - 1) { strength += 0.05; } // checks for amount of Uppercase Letters - if (password.match(reUPPERCASELETTER)?.length ?? 0 >= minUpperCase - 1) { + if ((password.match(reUPPERCASELETTER)?.length ?? 0) >= minUpperCase - 1) { strength += 0.05; } diff --git a/src/util/util/networking/abuseipdb/AbuseIpDbClient.ts b/src/util/util/networking/abuseipdb/AbuseIpDbClient.ts
index c4b69a48..b001fc75 100644 --- a/src/util/util/networking/abuseipdb/AbuseIpDbClient.ts +++ b/src/util/util/networking/abuseipdb/AbuseIpDbClient.ts
@@ -18,7 +18,7 @@ export class AbuseIpDbClient { static async checkIpAddress(ip: string): Promise<AbuseIpDbCheckResponse | null> { const { ipdataApiKey } = Config.get().security; if (!ipdataApiKey) return null; - if (this.ipCheckCache.get(ip)?.expires ?? 0 > Date.now()) return this.ipCheckCache.get(ip)!.data; + if ((this.ipCheckCache.get(ip)?.expires ?? 0) > Date.now()) return this.ipCheckCache.get(ip)!.data; console.log(`[AbuseIPDB] Checking IP address ${ip}...`); const resp = (await (await fetch(`https://api.abuseipdb.com/api/v2/check?ipAddress=${ip}`)).json()) as Promise<AbuseIpDbCheckResponse>; @@ -32,7 +32,7 @@ export class AbuseIpDbClient { static async getBlacklist(): Promise<AbuseIpDbBlacklistResponse | null> { const { abuseIpDbApiKey, abuseipdbBlacklistRatelimit } = Config.get().security; if (!abuseIpDbApiKey) return null; - if (this.blacklistCache?.expires ?? 0 > Date.now()) return this.blacklistCache!.data; + if ((this.blacklistCache?.expires ?? 0) > Date.now()) return this.blacklistCache!.data; console.log("[AbuseIPDB] Fetching blacklist..."); const resp = (await ( diff --git a/src/util/util/networking/ipdata/IpDataClient.ts b/src/util/util/networking/ipdata/IpDataClient.ts
index 2812ef59..b1551389 100644 --- a/src/util/util/networking/ipdata/IpDataClient.ts +++ b/src/util/util/networking/ipdata/IpDataClient.ts
@@ -13,7 +13,7 @@ export class IpDataClient { static async getIpInfo(ip: string): Promise<IpDataIpLookupResponse | null> { const { ipdataApiKey } = Config.get().security; if (!ipdataApiKey) return null; - if (this.ipInfoCache.get(ip)?.expires ?? 0 > Date.now()) return this.ipInfoCache.get(ip)!.data; + if ((this.ipInfoCache.get(ip)?.expires ?? 0) > Date.now()) return this.ipInfoCache.get(ip)!.data; console.log(`[IpData] Fetching info for IP address ${ip}...`); const response = await fetch(`https://eu-api.ipdata.co/${ip}?api-key=${ipdataApiKey}`);