lru-cache
Advanced tools
Comparing version 4.1.1 to 4.1.2
{ | ||
"name": "lru-cache", | ||
"description": "A cache object that deletes the least-recently-used items.", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"author": "Isaac Z. Schlueter <i@izs.me>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -28,6 +28,12 @@ # lru cache | ||
// non-string keys ARE fully supported | ||
var someObject = {} | ||
// but note that it must be THE SAME object, not | ||
// just a JSON-equivalent object. | ||
var someObject = { a: 1 } | ||
cache.set(someObject, 'a value') | ||
// Object keys are not toString()-ed | ||
cache.set('[object Object]', 'a different value') | ||
assert.equal(cache.get(someObject), 'a value') | ||
// A similar object with same keys/values won't work, | ||
// because it's a different object identity | ||
assert.equal(cache.get({ a: 1 }), undefined) | ||
@@ -34,0 +40,0 @@ cache.reset() // empty the cache |
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
17609
159