Skip to content

Commit 53e62fd

Browse files
committed
upgrade to 3.5.0 fixing lru typescript issue.
#84
1 parent 96d8854 commit 53e62fd

File tree

9 files changed

+62
-35
lines changed

9 files changed

+62
-35
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 3.5.0
4+
5+
- Upgrades underlying default LRU cache library to fix typescript errors (v6
6+
didn't provide types, but v7 and above do natively).
7+
38
## 3.4.6
49

510
- Last version (3.4.5) incorrectly published a bad dist output due to buggy

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ import IPinfoWrapper, { LruCache, Options } from "node-ipinfo";
8080

8181
const cacheOptions: Options<string, any> = {
8282
max: 5000,
83-
maxAge: 24 * 1000 * 60 * 60,
83+
ttl: 24 * 1000 * 60 * 60,
8484
};
8585
const cache = new LruCache(cacheOptions);
8686
const ipinfoWrapper = new IPinfoWrapper("MY_TOKEN", cache);
@@ -93,7 +93,7 @@ const { IPinfoWrapper, LruCache } = require("node-ipinfo");
9393

9494
const cacheOptions = {
9595
max: 5000,
96-
maxAge: 24 * 1000 * 60 * 60,
96+
ttl: 24 * 1000 * 60 * 60,
9797
};
9898
const cache = new LruCache(cacheOptions);
9999
const ipinfo = new IPinfoWrapper("MY_TOKEN", cache);

__tests__/ipinfoWrapper.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe("IPinfoWrapper", () => {
125125
},
126126
company: {
127127
name: "Level 3 Communications, Inc.",
128-
domain: "lumen.com",
128+
domain: "level3.com",
129129
type: "isp"
130130
},
131131
privacy: {
@@ -147,13 +147,13 @@ describe("IPinfoWrapper", () => {
147147
},
148148
domains: {
149149
ip: "4.4.4.4",
150-
total: 119,
150+
total: 127,
151151
domains: [
152152
"ncrsaas.com",
153-
"datacenterteam.de",
154-
"lavu-pos.com",
155-
"prodygy.biz",
156-
"giacomoni.ca",
153+
"fbidiy.net",
154+
"innnn.in",
155+
"safermoto.com",
156+
"shaoshuaitest0614.net",
157157
]
158158
},
159159
countryCode: "US"

package-lock.json

Lines changed: 43 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-ipinfo",
3-
"version": "3.4.6",
3+
"version": "3.5.0",
44
"description": "Official Node client library for IPinfo",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",
@@ -30,11 +30,10 @@
3030
"node": ">=10"
3131
},
3232
"dependencies": {
33-
"lru-cache": "^6.0.0",
33+
"lru-cache": "^7.18.3",
3434
"subnet-check": "^1.10.1"
3535
},
3636
"devDependencies": {
37-
"@types/lru-cache": "^7.10.10",
3837
"@types/jest": "^29.5.3",
3938
"@types/node": "^18.15.0",
4039
"dotenv": "^8.6.0",

src/cache/lruCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const cacheOptions: Options<string, any> = {
66
max: 5000,
77

88
// The maximum life of a cached item in milliseconds.
9-
maxAge: 24 * 1000 * 60 * 60
9+
ttl: 24 * 1000 * 60 * 60
1010
};
1111

1212
export default class LruCache implements IPCache {

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const VERSION = "3.4.6";
1+
const VERSION = "3.5.0";
22

33
export default VERSION;

test-app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let { IPinfoWrapper, LruCache } = require("node-ipinfo");
22

33
let cacheOptions = {
44
max: 5000,
5-
maxAge: 24 * 1000 * 60 * 60,
5+
ttl: 24 * 1000 * 60 * 60,
66
};
77
let cache = new LruCache(cacheOptions);
88

test-app/ipinfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import IPinfoWrapper, { LruCache, Options, IPinfo, AsnResponse } from "node-ipin
22

33
const cacheOptions: Options<string, any> = {
44
max: 5000,
5-
maxAge: 24 * 1000 * 60 * 60,
5+
ttl: 24 * 1000 * 60 * 60,
66
};
77
const cache = new LruCache(cacheOptions);
88

0 commit comments

Comments
 (0)