From 59d6f8d19f798acd8f727a8e817e567fb59e5e9a Mon Sep 17 00:00:00 2001 From: zdm Date: Mon, 10 Jul 2023 10:31:20 +0300 Subject: [PATCH] fix: build --- lib/geoip-asn.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/geoip-asn.js b/lib/geoip-asn.js index f309a70..7568905 100644 --- a/lib/geoip-asn.js +++ b/lib/geoip-asn.js @@ -1,20 +1,20 @@ -import MMDB from "mmdb-lib"; +import MMDB from "#core/mmdb"; import fs from "node:fs"; -import CacheLru from "#lib/cache/lru"; -import externalResources from "#lib/external-resources"; +import CacheLru from "#core/cache/lru"; +import externalResources from "#core/external-resources"; const cache = new CacheLru( { "maxSize": 1000 } ); var mmdb; -const resource = externalResources.add( "softvisio-node/core/resources/geolite2-country", import.meta.url ).on( "update", () => ( mmdb = null ) ); +const resource = externalResources.add( "softvisio-node/geoip-asn/resources/geolite2-asn", import.meta.url ).on( "update", () => ( mmdb = null ) ); class GeoipCountry { constructor () {} // public get ( ipAddress ) { - mmdb ??= new MMDB( fs.readFileSync( resource.location + "/GeoLite2-Country.mmdb" ), { cache } ); + mmdb ??= new MMDB( fs.readFileSync( resource.location + "/GeoLite2-ASN.mmdb" ), { cache } ); return mmdb.get( ipAddress ); }