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-05-11 17:23:07 +0300
committerGar <wraithgar@github.com>2022-05-11 18:38:33 +0300
commit0432c7d8a22ddbfdf238c2b22dd3c7bd263e2d6c (patch)
tree94647bf7a8c89b8f4d0c740209966d055fd793ae
parentcc7be6b8b63a7314066e8763589a57e5a6e77d30 (diff)
deps: lru-cache@7.9.0
-rw-r--r--node_modules/lru-cache/index.js52
-rw-r--r--node_modules/lru-cache/package.json3
-rw-r--r--package-lock.json12
3 files changed, 47 insertions, 20 deletions
diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js
index b63be6e98..fb1a076fa 100644
--- a/node_modules/lru-cache/index.js
+++ b/node_modules/lru-cache/index.js
@@ -1,15 +1,46 @@
const perf = typeof performance === 'object' && performance &&
typeof performance.now === 'function' ? performance : Date
-const hasAbortController = typeof AbortController !== 'undefined'
+const hasAbortController = typeof AbortController === 'function'
// minimal backwards-compatibility polyfill
+// this doesn't have nearly all the checks and whatnot that
+// actual AbortController/Signal has, but it's enough for
+// our purposes, and if used properly, behaves the same.
const AC = hasAbortController ? AbortController : Object.assign(
class AbortController {
constructor () { this.signal = new AC.AbortSignal }
- abort () { this.signal.aborted = true }
+ abort () {
+ this.signal.dispatchEvent('abort')
+ }
},
- { AbortSignal: class AbortSignal { constructor () { this.aborted = false }}}
+ {
+ AbortSignal: class AbortSignal {
+ constructor () {
+ this.aborted = false
+ this._listeners = []
+ }
+ dispatchEvent (type) {
+ if (type === 'abort') {
+ this.aborted = true
+ const e = { type, target: this }
+ this.onabort(e)
+ this._listeners.forEach(f => f(e), this)
+ }
+ }
+ onabort () {}
+ addEventListener (ev, fn) {
+ if (ev === 'abort') {
+ this._listeners.push(fn)
+ }
+ }
+ removeEventListener (ev, fn) {
+ if (ev === 'abort') {
+ this._listeners = this._listeners.filter(f => f !== fn)
+ }
+ }
+ }
+ }
)
const warned = new Set()
@@ -306,15 +337,6 @@ class LRUCache {
}
this.calculatedSize += this.sizes[index]
}
- this.delete = k => {
- if (this.size !== 0) {
- const index = this.keyMap.get(k)
- if (index !== undefined) {
- this.calculatedSize -= this.sizes[index]
- }
- }
- return LRUCache.prototype.delete.call(this, k)
- }
}
removeItemSize (index) {}
addItemSize (index, v, k, size) {}
@@ -730,6 +752,7 @@ class LRUCache {
deprecatedMethod('del', 'delete')
return this.delete
}
+
delete (k) {
let deleted = false
if (this.size !== 0) {
@@ -809,6 +832,7 @@ class LRUCache {
}
}
}
+
get reset () {
deprecatedMethod('reset', 'clear')
return this.clear
@@ -818,6 +842,10 @@ class LRUCache {
deprecatedProperty('length', 'size')
return this.size
}
+
+ static get AbortController () {
+ return AC
+ }
}
module.exports = LRUCache
diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json
index 32fb9da24..5364b09d2 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.8.1",
+ "version": "7.9.0",
"author": "Isaac Z. Schlueter <i@izs.me>",
"keywords": [
"mru",
@@ -23,7 +23,6 @@
"@size-limit/preset-small-lib": "^7.0.8",
"benchmark": "^2.1.4",
"clock-mock": "^1.0.4",
- "heapdump": "^0.3.15",
"size-limit": "^7.0.8",
"tap": "^15.1.6"
},
diff --git a/package-lock.json b/package-lock.json
index 309e9d123..446c018c7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4569,9 +4569,9 @@
}
},
"node_modules/lru-cache": {
- "version": "7.8.1",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz",
- "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==",
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.9.0.tgz",
+ "integrity": "sha512-lkcNMUKqdJk96TuIXUidxaPuEg5sJo/+ZyVE2BDFnuZGzwXem7d8582eG8vbu4todLfT14snP6iHriCHXXi5Rw==",
"inBundle": true,
"engines": {
"node": ">=12"
@@ -13239,9 +13239,9 @@
"peer": true
},
"lru-cache": {
- "version": "7.8.1",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz",
- "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg=="
+ "version": "7.9.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.9.0.tgz",
+ "integrity": "sha512-lkcNMUKqdJk96TuIXUidxaPuEg5sJo/+ZyVE2BDFnuZGzwXem7d8582eG8vbu4todLfT14snP6iHriCHXXi5Rw=="
},
"make-dir": {
"version": "3.1.0",