Socket
Socket
Sign inDemoInstall

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 1.3.3 to 1.4.0

0

bower.json

@@ -0,0 +0,0 @@ {

var path = require("path");
module.exports = require(path.join(__dirname, "lib", Number(process.version.replace("v", "").split(".")[0]) >= 6 ? "tiny-lru.es6" : "tiny-lru"));

18

lib/tiny-lru.es6.js

@@ -5,6 +5,6 @@ /**

* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @copyright 2016
* @copyright 2017
* @license BSD-3-Clause
* @link https://github.com/avoidwork/tiny-lru
* @version 1.3.3
* @version 1.4.0
*/

@@ -16,3 +16,2 @@ "use strict";

class LRU {

@@ -36,2 +35,15 @@ constructor (max) {

clear (silent = false) {
this.cache = {};
this.first = null;
this.last = null;
this.length = 0;
if (!silent && this.notify) {
next(this.onchange("clear", this.dump()));
}
return this;
}
delete (key) {

@@ -38,0 +50,0 @@ return this.remove(key);

@@ -5,6 +5,6 @@ /**

* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @copyright 2016
* @copyright 2017
* @license BSD-3-Clause
* @link https://github.com/avoidwork/tiny-lru
* @version 1.3.3
* @version 1.4.0
*/

@@ -45,2 +45,18 @@ "use strict";

_createClass(LRU, [{
key: "clear",
value: function clear() {
var silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
this.cache = {};
this.first = null;
this.last = null;
this.length = 0;
if (!silent && this.notify) {
next(this.onchange("clear", this.dump()));
}
return this;
}
}, {
key: "delete",

@@ -47,0 +63,0 @@ value: function _delete(key) {

2

package.json
{
"name": "tiny-lru",
"description": "Tiny LRU cache for Client or Server",
"version": "1.3.3",
"version": "1.4.0",
"homepage": "https://github.com/avoidwork/tiny-lru",

@@ -6,0 +6,0 @@ "author": "Jason Mulligan <jason.mulligan@avoidwork.com>",

@@ -21,2 +21,15 @@ # Tiny LRU

## clear
### Method
Clears the contents of the cache
return {Object} LRU instance
**Example**
```javascript
cache.clear();
```
## evict

@@ -176,3 +189,3 @@ ### Method

## License
Copyright (c) 2016 Jason Mulligan
Copyright (c) 2017 Jason Mulligan
Licensed under the BSD-3 license.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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