From d96367b1014de813e1f7b608d0d1167caae171b7 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 17 Jun 2024 18:42:08 +0200 Subject: [PATCH] Attempt to fix build --- src/main.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6cbb2b5..14ca0fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -154,7 +154,6 @@ export class Main { "ip", "ipNo" ] as const - private readonly keysSet = new Set(this.allowedKeys) constructor() { console.log("Loading databases from ./data/") @@ -190,14 +189,12 @@ export class Main { //see : https://github.com/kirsch33/realip/issues/14 const ipAddress = request.headers['x-forwarded-for'] const db = ipAddress.match(Main.ipv4Regex) ? this.ipv4 : this.ipv6 - const result: IP2LocationResult = db.getAll(ipAddress) - for (const k in result) { - if (!this.keysSet.has(k)) { - // @ts-ignore - delete result[k] - } + const fullResult = db.getAll(ipAddress) + const result = {} + for (const k in this.allowedKeys) { + result[k] = fullResult[k] } - return result + return result } }