Comparing version 4.0.1 to 4.0.2
@@ -8,3 +8,3 @@ /** | ||
* @link https://github.com/avoidwork/tiny-lru | ||
* @version 4.0.1 | ||
* @version 4.0.2 | ||
*/ | ||
@@ -17,2 +17,10 @@ "use strict"; | ||
function link (item, key) { | ||
item.next = key; | ||
if (item.previous === key) { | ||
item.previous = empty; | ||
} | ||
} | ||
function reset () { | ||
@@ -140,2 +148,3 @@ this.cache = {}; | ||
item.previous = this.first; | ||
link(this.cache[this.first], key); | ||
} | ||
@@ -162,11 +171,5 @@ | ||
} | ||
} | ||
if (this.first !== empty && this.first !== key) { | ||
const first = this.cache[this.first]; | ||
first.next = key; | ||
if (first.previous === key) { | ||
first.previous = empty; | ||
if (this.first !== empty && this.first !== key) { | ||
link(this.cache[this.first], key); | ||
} | ||
@@ -173,0 +176,0 @@ } |
{ | ||
"name": "tiny-lru", | ||
"description": "Tiny LRU cache for Client or Server", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"homepage": "https://github.com/avoidwork/tiny-lru", | ||
@@ -6,0 +6,0 @@ "author": "Jason Mulligan <jason.mulligan@avoidwork.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9836
192