Comparing version 3.0.7 to 4.0.0
@@ -8,3 +8,3 @@ /** | ||
* @link https://github.com/avoidwork/tiny-lru | ||
* @version 3.0.7 | ||
* @version 4.0.0 | ||
*/ | ||
@@ -17,2 +17,11 @@ "use strict"; | ||
function reset () { | ||
this.cache = {}; | ||
this.first = empty; | ||
this.last = empty; | ||
this.length = 0; | ||
return this; | ||
} | ||
class LRU { | ||
@@ -23,8 +32,7 @@ constructor (max, notify, ttl) { | ||
this.ttl = ttl; | ||
return this.reset(); | ||
reset.call(this); | ||
} | ||
clear (silent = false) { | ||
this.reset(); | ||
reset.call(this); | ||
@@ -124,11 +132,2 @@ if (silent === false && this.notify === true) { | ||
reset () { | ||
this.cache = {}; | ||
this.first = empty; | ||
this.last = empty; | ||
this.length = 0; | ||
return this; | ||
} | ||
set (key, value, silent = false, bypass = false) { | ||
@@ -135,0 +134,0 @@ if (bypass === true || this.has(key) === true) { |
{ | ||
"name": "tiny-lru", | ||
"description": "Tiny LRU cache for Client or Server", | ||
"version": "3.0.7", | ||
"version": "4.0.0", | ||
"homepage": "https://github.com/avoidwork/tiny-lru", | ||
@@ -6,0 +6,0 @@ "author": "Jason Mulligan <jason.mulligan@avoidwork.com>", |
@@ -159,15 +159,2 @@ # Tiny LRU | ||
## reset | ||
### Method | ||
Resets the cache to it's original state | ||
return {Object} LRU instance | ||
**Example** | ||
```javascript | ||
cache.reset(); | ||
``` | ||
## set | ||
@@ -174,0 +161,0 @@ ### Method |
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
10269
190