lru-cache
Advanced tools
Comparing version 7.16.0 to 7.16.1
37
index.js
@@ -21,3 +21,6 @@ const perf = | ||
abort() { | ||
this.signal.dispatchEvent('abort') | ||
this.signal.dispatchEvent({ | ||
type: 'abort', | ||
target: this.signal, | ||
}) | ||
} | ||
@@ -38,6 +41,5 @@ } | ||
} | ||
dispatchEvent(type) { | ||
if (type === 'abort') { | ||
dispatchEvent(e) { | ||
if (e.type === 'abort') { | ||
this.aborted = true | ||
const e = { type, target: this } | ||
this.onabort(e) | ||
@@ -475,3 +477,5 @@ this._listeners.forEach(f => f(e), this) | ||
for (const i of this.indexes()) { | ||
yield [this.keyList[i], this.valList[i]] | ||
if (!this.isBackgroundFetch(this.valList[i])) { | ||
yield [this.keyList[i], this.valList[i]] | ||
} | ||
} | ||
@@ -481,3 +485,5 @@ } | ||
for (const i of this.rindexes()) { | ||
yield [this.keyList[i], this.valList[i]] | ||
if (!this.isBackgroundFetch(this.valList[i])) { | ||
yield [this.keyList[i], this.valList[i]] | ||
} | ||
} | ||
@@ -488,3 +494,5 @@ } | ||
for (const i of this.indexes()) { | ||
yield this.keyList[i] | ||
if (!this.isBackgroundFetch(this.valList[i])) { | ||
yield this.keyList[i] | ||
} | ||
} | ||
@@ -494,3 +502,5 @@ } | ||
for (const i of this.rindexes()) { | ||
yield this.keyList[i] | ||
if (!this.isBackgroundFetch(this.valList[i])) { | ||
yield this.keyList[i] | ||
} | ||
} | ||
@@ -501,3 +511,5 @@ } | ||
for (const i of this.indexes()) { | ||
yield this.valList[i] | ||
if (!this.isBackgroundFetch(this.valList[i])) { | ||
yield this.valList[i] | ||
} | ||
} | ||
@@ -507,3 +519,5 @@ } | ||
for (const i of this.rindexes()) { | ||
yield this.valList[i] | ||
if (!this.isBackgroundFetch(this.valList[i])) { | ||
yield this.valList[i] | ||
} | ||
} | ||
@@ -560,2 +574,3 @@ } | ||
: v | ||
if (value === undefined) continue | ||
const entry = { value } | ||
@@ -629,2 +644,3 @@ if (this.ttls) { | ||
// update | ||
this.moveToTail(index) | ||
const oldVal = this.valList[index] | ||
@@ -646,3 +662,2 @@ if (v !== oldVal) { | ||
} | ||
this.moveToTail(index) | ||
} | ||
@@ -649,0 +664,0 @@ if (ttl !== 0 && this.ttl === 0 && !this.ttls) { |
{ | ||
"name": "lru-cache", | ||
"description": "A cache object that deletes the least-recently-used items.", | ||
"version": "7.16.0", | ||
"version": "7.16.1", | ||
"author": "Isaac Z. Schlueter <i@izs.me>", | ||
@@ -13,4 +13,6 @@ "keywords": [ | ||
"scripts": { | ||
"pretest": "node ./scripts/transpile-to-esm.mjs", | ||
"presnap": "node ./scripts/transpile-to-esm.mjs", | ||
"build": "npm run prepare", | ||
"pretest": "npm run prepare", | ||
"presnap": "npm run prepare", | ||
"prepare": "node ./scripts/transpile-to-esm.mjs", | ||
"size": "size-limit", | ||
@@ -17,0 +19,0 @@ "test": "tap", |
Sorry, the diff of this file is not supported yet
107704
2531
134
2
2
2
9