cache-manager
Advanced tools
Comparing version 2.8.0 to 2.9.0
@@ -0,1 +1,4 @@ | ||
- 2.9.0 2018-03-26 | ||
- Fix store's this context for isCacheableValue method (#119). -@alexandrusavin | ||
- 2.8.0 2018-02-28 | ||
@@ -2,0 +5,0 @@ - Added link to node-cache-manager-fs-hash - @rolandstarke |
@@ -41,3 +41,3 @@ /** @module cacheManager/caching */ | ||
} else if (typeof self.store.isCacheableValue === 'function') { | ||
self._isCacheableValue = self.store.isCacheableValue; | ||
self._isCacheableValue = self.store.isCacheableValue.bind(self.store); | ||
} else { | ||
@@ -44,0 +44,0 @@ self._isCacheableValue = function(value) { |
{ | ||
"name": "cache-manager", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "Cache module for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1237,2 +1237,20 @@ // TODO: These are really a mix of unit and integration tests. | ||
}); | ||
describe("when using store's isCacheableValue method", function() { | ||
it("should not break its' context", function() { | ||
var store = { | ||
isCacheableValue: function() { | ||
if (this !== store) { | ||
throw new Error("Broken store context"); | ||
} | ||
}, | ||
get: function() {}, | ||
set: function() {}, | ||
}; | ||
cache = caching({store: store}); | ||
assert.doesNotThrow(cache._isCacheableValue); | ||
}); | ||
}); | ||
}); |
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
198404
4191