Skip to content

Commit

Permalink
deps: lru-cache@10.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Dec 6, 2023
1 parent 71f70fa commit ff1204a
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 13 deletions.
1 change: 0 additions & 1 deletion DEPENDENCIES.md
Expand Up @@ -441,7 +441,6 @@ graph LR;
libnpmversion-->require-inject;
libnpmversion-->semver;
libnpmversion-->tap;
lru-cache-->semver;
lru-cache-->yallist;
make-fetch-happen-->cacache;
make-fetch-happen-->http-cache-semantics;
Expand Down
31 changes: 31 additions & 0 deletions node_modules/lru-cache/dist/commonjs/index.js
Expand Up @@ -736,6 +736,37 @@ class LRUCache {
}
return deleted;
}
/**
* Get the extended info about a given entry, to get its value, size, and
* TTL info simultaneously. Like {@link LRUCache#dump}, but just for a
* single key. Always returns stale values, if their info is found in the
* cache, so be sure to check for expired TTLs if relevant.
*/
info(key) {
const i = this.#keyMap.get(key);
if (i === undefined)
return undefined;
const v = this.#valList[i];
const value = this.#isBackgroundFetch(v)
? v.__staleWhileFetching
: v;
if (value === undefined)
return undefined;
const entry = { value };
if (this.#ttls && this.#starts) {
const ttl = this.#ttls[i];
const start = this.#starts[i];
if (ttl && start) {
const remain = ttl - (perf.now() - start);
entry.ttl = remain;
entry.start = Date.now();
}
}
if (this.#sizes) {
entry.size = this.#sizes[i];
}
return entry;
}
/**
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
* passed to cache.load()
Expand Down
31 changes: 31 additions & 0 deletions node_modules/lru-cache/dist/esm/index.js
Expand Up @@ -733,6 +733,37 @@ export class LRUCache {
}
return deleted;
}
/**
* Get the extended info about a given entry, to get its value, size, and
* TTL info simultaneously. Like {@link LRUCache#dump}, but just for a
* single key. Always returns stale values, if their info is found in the
* cache, so be sure to check for expired TTLs if relevant.
*/
info(key) {
const i = this.#keyMap.get(key);
if (i === undefined)
return undefined;
const v = this.#valList[i];
const value = this.#isBackgroundFetch(v)
? v.__staleWhileFetching
: v;
if (value === undefined)
return undefined;
const entry = { value };
if (this.#ttls && this.#starts) {
const ttl = this.#ttls[i];
const start = this.#starts[i];
if (ttl && start) {
const remain = ttl - (perf.now() - start);
entry.ttl = remain;
entry.start = Date.now();
}
}
if (this.#sizes) {
entry.size = this.#sizes[i];
}
return entry;
}
/**
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
* passed to cache.load()
Expand Down
12 changes: 6 additions & 6 deletions node_modules/lru-cache/package.json
@@ -1,7 +1,7 @@
{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
"version": "10.0.2",
"version": "10.1.0",
"author": "Isaac Z. Schlueter <i@izs.me>",
"keywords": [
"mru",
Expand Down Expand Up @@ -45,7 +45,10 @@
}
}
},
"repository": "git://github.com/isaacs/node-lru-cache.git",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-lru-cache.git"
},
"devDependencies": {
"@tapjs/clock": "^1.1.16",
"@types/node": "^20.2.5",
Expand Down Expand Up @@ -111,8 +114,5 @@
}
}
},
"type": "module",
"dependencies": {
"semver": "^7.3.5"
}
"type": "module"
}
9 changes: 3 additions & 6 deletions package-lock.json
Expand Up @@ -10248,13 +10248,10 @@
}
},
"node_modules/lru-cache": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.2.tgz",
"integrity": "sha512-Yj9mA8fPiVgOUpByoTZO5pNrcl5Yk37FcSHsUINpAsaBIEZIuqcCclDZJCVxqQShDsmYX8QG63svJiTbOATZwg==",
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz",
"integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==",
"inBundle": true,
"dependencies": {
"semver": "^7.3.5"
},
"engines": {
"node": "14 || >=16.14"
}
Expand Down

0 comments on commit ff1204a

Please sign in to comment.