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

brave-cache

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brave-cache - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

10

package.json
{
"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 @@ }

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