cache-manager
Advanced tools
Comparing version 3.2.1 to 3.3.0
@@ -0,1 +1,4 @@ | ||
- 3.3.0 2020-04-30 | ||
- Use full lodash lib instead of lodash.clonedeep npm (#141) | ||
- 3.2.1 2020-03-20 | ||
@@ -2,0 +5,0 @@ - Background refresh fixes (#139). -@marcoreni |
/*eslint no-unused-vars:0*/ | ||
var Lru = require("lru-cache"); | ||
var cloneDeep = require('lodash.clonedeep'); | ||
var cloneDeep = require('lodash/cloneDeep'); | ||
var utils = require('../utils'); | ||
@@ -5,0 +5,0 @@ var isObject = utils.isObject; |
{ | ||
"name": "cache-manager", | ||
"version": "3.2.1", | ||
"version": "3.3.0", | ||
"description": "Cache module for Node.js", | ||
@@ -23,4 +23,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"lodash.clonedeep": "4.5.0", | ||
"async": "1.5.2", | ||
"lodash": "^4.17.15", | ||
"lru-cache": "4.0.0" | ||
@@ -27,0 +27,0 @@ }, |
@@ -1465,7 +1465,6 @@ // TODO: These are really a mix of unit and integration tests. | ||
return 'OK'; | ||
}) | ||
.then(function(res) { | ||
assert.equal(res, 'OK'); | ||
done(); | ||
}); | ||
}).then(function(res) { | ||
assert.equal(res, 'OK'); | ||
done(); | ||
}); | ||
}); | ||
@@ -1478,7 +1477,17 @@ | ||
}); | ||
}) | ||
.then(function(res) { | ||
assert.equal(res, 'OK'); | ||
done(); | ||
}).then(function(res) { | ||
assert.equal(res, 'OK'); | ||
done(); | ||
}); | ||
}); | ||
it("should be able use a ttl while chaining cache function as a promise", function(done) { | ||
cache.wrap('key', function() { | ||
return new Promise(function(resolve) { | ||
resolve('OK'); | ||
}); | ||
}, {ttl: 10}).then(function(res) { | ||
assert.equal(res, 'OK'); | ||
done(); | ||
}); | ||
}); | ||
@@ -1491,9 +1500,7 @@ | ||
}); | ||
}) | ||
.then(function() { | ||
done(new Error('It should not call then since there is an error in the cache function!')); | ||
}) | ||
.catch(function() { | ||
done(); | ||
}); | ||
}).then(function() { | ||
done(new Error('It should not call "then" since there is an error in the cache function!')); | ||
}).catch(function() { | ||
done(); | ||
}); | ||
}); | ||
@@ -1504,7 +1511,6 @@ | ||
return; | ||
}) | ||
.then(function(res) { | ||
assert.equal(res, undefined); | ||
done(); | ||
}); | ||
}).then(function(res) { | ||
assert.equal(res, undefined); | ||
done(); | ||
}); | ||
}); | ||
@@ -1511,0 +1517,0 @@ }); |
@@ -52,3 +52,3 @@ var assert = require('assert'); | ||
cache.wrap(key, function(cacheCb) { | ||
cacheCb(null, {foo: 'bar'}); | ||
cacheCb(null, {foo: 'bar', arr: [1, 2, 3]}); | ||
}, opts, cb); | ||
@@ -114,2 +114,3 @@ } | ||
assert.equal(result.foo, 'bar'); | ||
assert.deepEqual(result.arr, [1, 2, 3]); | ||
done(); | ||
@@ -116,0 +117,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
255113
5373
+ Addedlodash@^4.17.15
+ Addedlodash@4.17.21(transitive)
- Removedlodash.clonedeep@4.5.0
- Removedlodash.clonedeep@4.5.0(transitive)