diff --git a/CHANGELOG.md b/CHANGELOG.md index af63e07..f424689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 3.5.1 + +- Inlined files that were previously being loaded as JSON files. + ## 3.5.0 - Upgrades underlying default LRU cache library to fix typescript errors (v6 diff --git a/src/ipinfoWrapper.ts b/src/ipinfoWrapper.ts index c03420b..7d020a8 100644 --- a/src/ipinfoWrapper.ts +++ b/src/ipinfoWrapper.ts @@ -6,7 +6,7 @@ import { countriesFlags, countries, euCountries -} from "../config/utils" +} from "../config/utils"; import Cache from "./cache/cache"; import LruCache from "./cache/lruCache"; import ApiLimitError from "./errors/apiLimitError"; @@ -26,7 +26,7 @@ import { import VERSION from "./version"; const clientUserAgent = `IPinfoClient/nodejs/${VERSION}`; -const countryFlagURL = "https://cdn.ipinfo.io/static/images/countries-flags/" +const countryFlagURL = "https://cdn.ipinfo.io/static/images/countries-flags/"; export default class IPinfoWrapper { private token: string; @@ -120,8 +120,10 @@ export default class IPinfoWrapper { this.countries[ipinfo.countryCode]; ipinfo.countryFlag = this.countriesFlags[ipinfo.countryCode]; - ipinfo.countryFlagURL = - countryFlagURL + ipinfo.countryCode + ".svg" + ipinfo.countryFlagURL = + countryFlagURL + + ipinfo.countryCode + + ".svg"; ipinfo.countryCurrency = this.countriesCurrencies[ ipinfo.countryCode @@ -415,7 +417,9 @@ export default class IPinfoWrapper { // filter out URLs already cached. const lookupUrls: string[] = []; for (const url of urls) { - const cachedUrl = await this.cache.get(IPinfoWrapper.cacheKey(url)); + const cachedUrl = await this.cache.get( + IPinfoWrapper.cacheKey(url) + ); if (cachedUrl) { result[url] = cachedUrl; } else { @@ -508,7 +512,7 @@ export default class IPinfoWrapper { } private isBogon(ip: string): boolean { - if (ip != '') { + if (ip != "") { for (var network of BOGON_NETWORKS) { if (isInSubnet(ip, network)) { return true; diff --git a/src/version.ts b/src/version.ts index c78e93d..c2689de 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,3 +1,3 @@ -const VERSION = "3.5.0"; +const VERSION = "3.5.1"; export default VERSION; diff --git a/test-app/package.json b/test-app/package.json index d73e0ff..452c517 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -9,7 +9,7 @@ "author": "", "license": "ISC", "dependencies": { - "node-ipinfo": "3.5.0", + "node-ipinfo": "3.5.1", "typescript": "^4.4.2" } }