Skip to content

Commit

Permalink
Fixing keys() for empty caches
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Oct 29, 2023
1 parent 21bfcd3 commit db61658
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions dist/tiny-lru.cjs
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 11.2.4
* @version 11.2.5
*/
'use strict';

Expand Down Expand Up @@ -111,10 +111,10 @@ class LRU {
const result = [];
let x = this.first;

do {
while (x !== null) {
result.push(x.key);
x = x.next;
} while (x !== null);
}

return result;
}
Expand Down
6 changes: 3 additions & 3 deletions dist/tiny-lru.js
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 11.2.4
* @version 11.2.5
*/
class LRU {
constructor (max = 0, ttl = 0, resetTtl = false) {
Expand Down Expand Up @@ -109,10 +109,10 @@ class LRU {
const result = [];
let x = this.first;

do {
while (x !== null) {
result.push(x.key);
x = x.next;
} while (x !== null);
}

return result;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/tiny-lru.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tiny-lru.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/tiny-lru.umd.js
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 11.2.4
* @version 11.2.5
*/
(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.lru={}));})(this,(function(exports){'use strict';class LRU {
constructor (max = 0, ttl = 0, resetTtl = false) {
Expand Down Expand Up @@ -109,10 +109,10 @@
const result = [];
let x = this.first;

do {
while (x !== null) {
result.push(x.key);
x = x.next;
} while (x !== null);
}

return result;
}
Expand Down

0 comments on commit db61658

Please sign in to comment.