Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@
* @since 1.0.0
*/
delete (key) {
if (this.has(key)) {
const item = this.items[key];
Comment thread
cesco69 marked this conversation as resolved.
if (item !== undefined) {
const item = this.items[key];

Check failure on line 81 in src/lru.js

View workflow job for this annotation

GitHub Actions / build (24.x)

'item' is already declared in the upper scope on line 79 column 9

Check failure on line 81 in src/lru.js

View workflow job for this annotation

GitHub Actions / build (22.x)

'item' is already declared in the upper scope on line 79 column 9

Check failure on line 81 in src/lru.js

View workflow job for this annotation

GitHub Actions / build (20.x)

'item' is already declared in the upper scope on line 79 column 9

delete this.items[key];
this.size--;
Expand Down Expand Up @@ -176,9 +177,9 @@
*/
expiresAt (key) {
let result;

if (this.has(key)) {
result = this.items[key].expiry;
const item = this.items[key];
if (item !== undefined) {
result = item.expiry;
}

return result;
Expand Down
Loading