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

cache-manager

Package Overview
Dependencies
Maintainers
1
Versions
110
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 2.5.0 to 2.6.0

3

History.md

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

- 2.6.0 2017-12-08
- fix multicaching when result is not cacheable (#106) - @gswalden
- 2.5.0 2017-10-09

@@ -2,0 +5,0 @@ - Add explicit return in wrapPromise (#109) - @jeff-kilbride

2

lib/multi_caching.js

@@ -242,3 +242,3 @@ /** @module cacheManager/multiCaching */

if (!self._isCacheableValue(data)) {
return cb();
return callbackFiller.fill(key, err, data);
}

@@ -245,0 +245,0 @@

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

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

@@ -709,2 +709,54 @@ var assert = require('assert');

});
it("allows repeated calls for uncacheable value", function(done) {
function getUndefined(name, cb) {
multiCache.wrap(key, function(cacheCb) {
process.nextTick(function() {
cacheCb(null, undefined);
});
}, cb);
}
var name = 'oof';
getUndefined(name, function(err, val) {
checkErr(err);
assert.ok(val === undefined);
getUndefined(name, function(err, val) {
checkErr(err);
assert.ok(val === undefined);
done();
});
});
});
it("allows simultaneous calls for uncacheable value", function(done) {
var results = [true, undefined];
function getUndefined(name, cb) {
multiCache.wrap(key, function(cacheCb) {
process.nextTick(function() {
cacheCb(null, results.pop());
});
}, cb);
}
var name = 'oof';
getUndefined(name, function(err, val) {
checkErr(err);
assert.ok(val === undefined);
});
getUndefined(name, function(err, val) {
checkErr(err);
assert.ok(val === undefined);
// ensure we didn't cache "undefined"
getUndefined(name, function(err, val) {
checkErr(err);
assert.ok(val === true);
done();
});
});
});
});

@@ -711,0 +763,0 @@ });

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