Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-04-06 19:24:11 +0300
committerGar <wraithgar@github.com>2022-04-07 00:29:40 +0300
commitc44c2b02920854897ba7a663ef705b9b474c2250 (patch)
tree3435fdbe73626c621524a27ff7f57ba0313148e8
parent69d834319a9d668bd451600ab6e124a8819b284d (diff)
deps: lru-cache@7.7.3
-rw-r--r--node_modules/lru-cache/index.js19
-rw-r--r--node_modules/lru-cache/package.json4
-rw-r--r--package-lock.json9
3 files changed, 21 insertions, 11 deletions
diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js
index 978b8f4ee..2168fd3a6 100644
--- a/node_modules/lru-cache/index.js
+++ b/node_modules/lru-cache/index.js
@@ -127,7 +127,7 @@ class LRUCache {
throw new TypeError('cannot set sizeCalculation without setting maxSize')
}
if (typeof this.sizeCalculation !== 'function') {
- throw new TypeError('sizeCalculating set to non-function')
+ throw new TypeError('sizeCalculation set to non-function')
}
}
@@ -273,11 +273,18 @@ class LRUCache {
this.sizes = new ZeroArray(this.max)
this.removeItemSize = index => this.calculatedSize -= this.sizes[index]
this.requireSize = (k, v, size, sizeCalculation) => {
- if (sizeCalculation && !size) {
- size = sizeCalculation(v, k)
- }
if (!isPosInt(size)) {
- throw new TypeError('size must be positive integer')
+ if (sizeCalculation) {
+ if (typeof sizeCalculation !== 'function') {
+ throw new TypeError('sizeCalculation must be a function')
+ }
+ size = sizeCalculation(v, k)
+ if (!isPosInt(size)) {
+ throw new TypeError('sizeCalculation return invalid (expect positive integer)')
+ }
+ } else {
+ throw new TypeError('invalid size value (must be positive integer)')
+ }
}
return size
}
@@ -559,7 +566,7 @@ class LRUCache {
if (this.isBackgroundFetch(v)) {
return v
}
- const ac = new AbortController()
+ const ac = new AC()
const fetchOpts = {
signal: ac.signal,
options,
diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json
index 84d199c2b..ca75abf00 100644
--- a/node_modules/lru-cache/package.json
+++ b/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": "7.7.1",
+ "version": "7.7.3",
"author": "Isaac Z. Schlueter <i@izs.me>",
"keywords": [
"mru",
@@ -22,7 +22,7 @@
"devDependencies": {
"@size-limit/preset-small-lib": "^7.0.8",
"benchmark": "^2.1.4",
- "clock-mock": "^1.0.3",
+ "clock-mock": "^1.0.4",
"size-limit": "^7.0.8",
"tap": "^15.1.6"
},
diff --git a/package-lock.json b/package-lock.json
index e0ddcc99c..5c9f21f3c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4525,9 +4525,10 @@
}
},
"node_modules/lru-cache": {
- "version": "7.7.1",
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz",
+ "integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==",
"inBundle": true,
- "license": "ISC",
"engines": {
"node": ">=12"
}
@@ -12859,7 +12860,9 @@
"peer": true
},
"lru-cache": {
- "version": "7.7.1"
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz",
+ "integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw=="
},
"make-dir": {
"version": "3.1.0",