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 1.4.7 to 1.4.8

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"));

20

lib/tiny-lru.es6.js

@@ -8,3 +8,3 @@ /**

* @link https://github.com/avoidwork/tiny-lru
* @version 1.4.7
* @version 1.4.8
*/

@@ -86,4 +86,5 @@ "use strict";

remove (key, silent = false) {
let cached = this.cache[key];
remove (k, silent = false) {
let key = typeof k !== "string" ? k.toString() : k,
cached = this.cache[key];

@@ -131,3 +132,3 @@ if (cached) {

set (key, value) {
let item;
let first, item;

@@ -139,2 +140,6 @@ if (this.has(key)) {

item.previous = this.first;
if (this.last === key) {
this.last = item.previous;
}
} else {

@@ -157,3 +162,8 @@ if (++this.length > this.max) {

if (this.first) {
this.cache[this.first].next = key;
first = this.cache[this.first];
first.next = key;
if (first.previous === key) {
first.previous = null;
}
}

@@ -160,0 +170,0 @@

@@ -8,3 +8,3 @@ /**

* @link https://github.com/avoidwork/tiny-lru
* @version 1.4.7
* @version 1.4.8
*/

@@ -108,6 +108,7 @@ "use strict";

key: "remove",
value: function remove(key) {
value: function remove(k) {
var silent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var cached = this.cache[key];
var key = typeof k !== "string" ? k.toString() : k,
cached = this.cache[key];

@@ -156,3 +157,4 @@ if (cached) {

value: function set(key, value) {
var item = void 0;
var first = void 0,
item = void 0;

@@ -164,2 +166,6 @@ if (this.has(key)) {

item.previous = this.first;
if (this.last === key) {
this.last = item.previous;
}
} else {

@@ -182,3 +188,8 @@ if (++this.length > this.max) {

if (this.first) {
this.cache[this.first].next = key;
first = this.cache[this.first];
first.next = key;
if (first.previous === key) {
first.previous = null;
}
}

@@ -185,0 +196,0 @@

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

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

@@ -0,0 +0,0 @@ # Tiny LRU

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