New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

appolo-cache

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appolo-cache - npm Package Compare versions

Comparing version 6.0.3 to 6.0.4

39

lib/cache.js

@@ -60,3 +60,3 @@ "use strict";

this._cache.forEach((item, key) => {
item = this.getItem(key);
item = this.peekItem(key);
if (item) {

@@ -69,5 +69,8 @@ fn.call($this || null, item.value, item.key);

let output = [];
this.forEach((value, key) => {
output.push(key);
});
let keys = this._cache.keys();
for (let key of keys) {
if (this.peek(key)) {
output.push(key);
}
}
return output;

@@ -77,11 +80,15 @@ }

let output = [];
this.forEach((value, key) => {
output.push(value);
});
let keys = this._cache.keys();
for (let key of keys) {
let value = this.peek(key);
if (value) {
output.push(value);
}
}
return output;
}
prune() {
let keys = this.keys();
for (let i = 0, len = keys.length; i < len; i++) {
this._isValidExpire(this._cache[keys[i]]);
let keys = this._cache.keys();
for (let key of keys) {
this._isValidExpire(this._cache.get(key));
}

@@ -174,5 +181,2 @@ }

}
// if (item.maxAge > 0) {
// item.modified = Date.now();
// }
}

@@ -208,4 +212,13 @@ _link(item) {

}
clear(n) {
this.prune();
for (let i = 0, len = n; i < len; i++) {
this.del(this._tail.key);
}
}
clearHalf() {
this.clear(Math.floor(this._size / 2));
}
}
exports.Cache = Cache;
//# sourceMappingURL=cache.js.map

@@ -90,3 +90,3 @@ import {ListItem} from "./listItem";

this._cache.forEach((item, key) => {
item = this.getItem(key);
item = this.peekItem(key);
if (item) {

@@ -98,9 +98,13 @@ fn.call($this || null, item.value, item.key)

public keys() {
public keys(): K[] {
let output = [];
this.forEach((value: T, key) => {
output.push(key);
});
let keys = this._cache.keys();
for (let key of keys) {
if (this.peek(key)) {
output.push(key);
}
}
return output;

@@ -112,6 +116,13 @@ }

this.forEach((value: T, key) => {
output.push(value);
});
let keys = this._cache.keys();
for (let key of keys) {
let value = this.peek(key);
if (value) {
output.push(value);
}
}
return output;

@@ -121,5 +132,7 @@ }

public prune() {
let keys = this.keys();
for (let i = 0, len = keys.length; i < len; i++) {
this._isValidExpire(this._cache[keys[i]]);
let keys = this._cache.keys();
for (let key of keys) {
this._isValidExpire(this._cache.get(key));
}

@@ -183,3 +196,2 @@ }

private _del(item: ListItem<K, T>) {

@@ -246,6 +258,2 @@ this._unlink(item);

}
// if (item.maxAge > 0) {
// item.modified = Date.now();
// }
}

@@ -294,2 +302,13 @@

public clear(n: number) {
this.prune();
for (let i = 0, len = n; i < len; i++) {
this.del(this._tail.key);
}
}
public clearHalf() {
this.clear(Math.floor(this._size / 2));
}
}

@@ -21,3 +21,3 @@ {

"main": "./index.js",
"version": "6.0.3",
"version": "6.0.4",
"license": "MIT",

@@ -24,0 +24,0 @@ "repository": {

# Appolo lru cache
[![Build Status](https://travis-ci.org/shmoop207/appolo-cache.svg?branch=master)](https://travis-ci.org/shmoop207/appolo-cache) [![Dependencies status](https://david-dm.org/shmoop207/appolo-cache.svg)](https://david-dm.org/shmoop207/appolo-cache) [![NPM version](https://badge.fury.io/js/appolo-cache.svg)](https://badge.fury.io/js/appolo-cache) [![npm Downloads](https://img.shields.io/npm/dm/appolo-cache.svg?style=flat)](https://www.npmjs.com/package/appolo-cache)
[![Known Vulnerabilities](https://snyk.io/test/github/shmoop207/appolo-cache/badge.svg)](https://snyk.io/test/github/shmoop207/appolo-cache)
Fast and simple lru cache for node.js written in typescript.

@@ -3,0 +6,0 @@

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