We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d78a9a commit f8903afCopy full SHA for f8903af
1 file changed
src/lru.js
@@ -76,7 +76,8 @@ export class LRU {
76
* @since 1.0.0
77
*/
78
delete (key) {
79
- if (this.has(key)) {
+ const item = this.items[key];
80
+ if (item !== undefined) {
81
const item = this.items[key];
82
83
delete this.items[key];
@@ -176,9 +177,9 @@ export class LRU {
176
177
178
expiresAt (key) {
179
let result;
-
180
181
- result = this.items[key].expiry;
182
+ result = item.expiry;
183
}
184
185
return result;
0 commit comments