Socket
Socket
Sign inDemoInstall

cache-manager

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-manager - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

3

History.md

@@ -0,1 +1,4 @@

- 4.0.1
- Fix TTL option bug for memory cache (#194). - @anchan828
- 4.0.0

@@ -2,0 +5,0 @@ - Upgrade to lru-cache 7.x (#193). - @orgads

15

lib/stores/memory.js

@@ -33,7 +33,6 @@ /*eslint no-unused-vars:0*/

var ttl = args.ttl;
var lruOpts = {
max: args.max || 500,
maxSize: args.maxSize,
ttl: (ttl || ttl === 0) ? ttl * 1000 : null,
ttl: (args.ttl || args.ttl === 0) ? args.ttl * 1000 : undefined,
dispose: args.dispose,

@@ -48,7 +47,7 @@ sizeCalculation: args.sizeCalculation || args.length,

var setMultipleKeys = function setMultipleKeys(keysValues, maxAge) {
var setMultipleKeys = function setMultipleKeys(keysValues, ttl) {
var length = keysValues.length;
var values = [];
for (var i = 0; i < length; i += 2) {
lruCache.set(keysValues[i], keysValues[i + 1], maxAge);
lruCache.set(keysValues[i], keysValues[i + 1], {ttl});
values.push(keysValues[i + 1]);

@@ -70,5 +69,5 @@ }

var maxAge = (options.ttl || options.ttl === 0) ? options.ttl * 1000 : lruOpts.maxAge;
var ttl = (options.ttl || options.ttl === 0) ? options.ttl * 1000 : lruOpts.ttl;
lruCache.set(key, value, maxAge);
lruCache.set(key, value, {ttl});
if (cb) {

@@ -94,5 +93,5 @@ process.nextTick(cb.bind(null, null));

var maxAge = (options.ttl || options.ttl === 0) ? options.ttl * 1000 : lruOpts.maxAge;
var ttl = (options.ttl || options.ttl === 0) ? options.ttl * 1000 : lruOpts.ttl;
var values = setMultipleKeys(args, maxAge);
var values = setMultipleKeys(args, ttl);

@@ -99,0 +98,0 @@ if (cb) {

{
"name": "cache-manager",
"version": "4.0.0",
"version": "4.0.1",
"description": "Cache module for Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

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