brave-cache
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "brave-cache", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A flexible semantic Api for handling multiple node cache drivers.", | ||
@@ -18,10 +18,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/lru-cache": "^5.1.1", | ||
"@types/lru-cache": "^7.6.1", | ||
"@types/node": "^17.0.8", | ||
"@types/random-words": "^1.1.2", | ||
"japa": "^4.0.0", | ||
"lru-cache": "^6.0.0", | ||
"lru-cache": "^7.7.2", | ||
"node-cache": "^5.1.2", | ||
"nodemon": "^2.0.15", | ||
"prettier": "^2.5.1", | ||
"prettier": "^2.6.1", | ||
"random-words": "^1.1.1", | ||
@@ -40,4 +40,4 @@ "ts-node": "^10.4.0", | ||
"dependencies": { | ||
"object-collection": "^3.0.0" | ||
"object-collection": "^3.0.1" | ||
} | ||
} |
@@ -13,2 +13,2 @@ /** | ||
*/ | ||
export default function LRUCacheProvider(options?: LRUCache.Options<string, any>): BraveCacheProvider<LRUCache<string, any>>; | ||
export default function LRUCacheProvider(options?: LRUCache.Options<any, any>): BraveCacheProvider<LRUCache<string, any>>; |
@@ -19,3 +19,3 @@ "use strict"; | ||
function LRUCacheProvider(options = {}) { | ||
const cache = new lru_cache_1.default(Object.assign({ max: 0, maxAge: 1000 * 60 * 60 * 24 * 7 }, options)); | ||
const cache = new lru_cache_1.default(Object.assign({ max: 1000 }, options)); | ||
return new provider_1.default({ | ||
@@ -30,6 +30,6 @@ name: "lru-cache", | ||
// Since LRUCache supports milliseconds instead of seconds, we need to convert. | ||
return cache.set(key, value, ttl ? ttl * 1000 : undefined); | ||
return cache.set(key, value, { ttl: ttl ? ttl * 1000 : undefined }); | ||
}, | ||
del(key) { | ||
return cache.del(key); | ||
return cache.delete(key); | ||
}, | ||
@@ -40,6 +40,6 @@ has(key) { | ||
flush() { | ||
return cache.reset(); | ||
return cache.clear(); | ||
}, | ||
keys() { | ||
return cache.keys(); | ||
return [...cache.keys()]; | ||
} | ||
@@ -46,0 +46,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
38030
Updatedobject-collection@^3.0.1