Skip to content

Commit 107ec03

Browse files
committed
deps: lru-cache@7.7.3
1 parent 6be63c4 commit 107ec03

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

node_modules/lru-cache/index.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class LRUCache {
127127
throw new TypeError('cannot set sizeCalculation without setting maxSize')
128128
}
129129
if (typeof this.sizeCalculation !== 'function') {
130-
throw new TypeError('sizeCalculating set to non-function')
130+
throw new TypeError('sizeCalculation set to non-function')
131131
}
132132
}
133133

@@ -273,11 +273,18 @@ class LRUCache {
273273
this.sizes = new ZeroArray(this.max)
274274
this.removeItemSize = index => this.calculatedSize -= this.sizes[index]
275275
this.requireSize = (k, v, size, sizeCalculation) => {
276-
if (sizeCalculation && !size) {
277-
size = sizeCalculation(v, k)
278-
}
279276
if (!isPosInt(size)) {
280-
throw new TypeError('size must be positive integer')
277+
if (sizeCalculation) {
278+
if (typeof sizeCalculation !== 'function') {
279+
throw new TypeError('sizeCalculation must be a function')
280+
}
281+
size = sizeCalculation(v, k)
282+
if (!isPosInt(size)) {
283+
throw new TypeError('sizeCalculation return invalid (expect positive integer)')
284+
}
285+
} else {
286+
throw new TypeError('invalid size value (must be positive integer)')
287+
}
281288
}
282289
return size
283290
}
@@ -559,7 +566,7 @@ class LRUCache {
559566
if (this.isBackgroundFetch(v)) {
560567
return v
561568
}
562-
const ac = new AbortController()
569+
const ac = new AC()
563570
const fetchOpts = {
564571
signal: ac.signal,
565572
options,

node_modules/lru-cache/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lru-cache",
33
"description": "A cache object that deletes the least-recently-used items.",
4-
"version": "7.7.1",
4+
"version": "7.7.3",
55
"author": "Isaac Z. Schlueter <i@izs.me>",
66
"keywords": [
77
"mru",
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"@size-limit/preset-small-lib": "^7.0.8",
2424
"benchmark": "^2.1.4",
25-
"clock-mock": "^1.0.3",
25+
"clock-mock": "^1.0.4",
2626
"size-limit": "^7.0.8",
2727
"tap": "^15.1.6"
2828
},

package-lock.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4605,9 +4605,10 @@
46054605
}
46064606
},
46074607
"node_modules/lru-cache": {
4608-
"version": "7.7.1",
4608+
"version": "7.7.3",
4609+
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz",
4610+
"integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==",
46094611
"inBundle": true,
4610-
"license": "ISC",
46114612
"engines": {
46124613
"node": ">=12"
46134614
}
@@ -13040,7 +13041,9 @@
1304013041
"peer": true
1304113042
},
1304213043
"lru-cache": {
13043-
"version": "7.7.1"
13044+
"version": "7.7.3",
13045+
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz",
13046+
"integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw=="
1304413047
},
1304513048
"make-dir": {
1304613049
"version": "3.1.0",

0 commit comments

Comments
 (0)