Skip to content

Commit

Permalink
upgrade to v3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
UmanShahzad committed Nov 27, 2023
1 parent fdf8b9f commit 0c2e088
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 10 additions & 6 deletions src/ipinfoWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const VERSION = "3.5.0";
const VERSION = "3.5.1";

export default VERSION;
2 changes: 1 addition & 1 deletion test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"node-ipinfo": "3.5.0",
"node-ipinfo": "3.5.1",
"typescript": "^4.4.2"
}
}

0 comments on commit 0c2e088

Please sign in to comment.