Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiny-lru

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-lru - npm Package Compare versions

Comparing version 3.0.7 to 4.0.0

25

lib/tiny-lru.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc