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

@type-cacheable/lru-cache-adapter

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@type-cacheable/lru-cache-adapter - npm Package Compare versions

Comparing version 8.0.5 to 9.0.1

14

dist/index.js

@@ -31,7 +31,13 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
return Promise.resolve(this.lruClient.set(cacheKey, value, ttl));
// the lru-cache takes ttl in ms instead of seconds, so convert seconds to ms
return Promise.resolve(this.lruClient.set(cacheKey, value, ttl ? ttl * 1000 : undefined));
});
}
getClientTTL() {
return this.lruClient.maxAge;
try {
return this.lruClient.maxAge / 1000;
}
catch (_a) {
return 0;
}
}

@@ -65,3 +71,5 @@ del(keyOrKeys) {

return __awaiter(this, void 0, void 0, function* () {
const finalDeleteKeys = Array.isArray(hashKeyOrKeys) ? hashKeyOrKeys : [hashKeyOrKeys];
const finalDeleteKeys = Array.isArray(hashKeyOrKeys)
? hashKeyOrKeys
: [hashKeyOrKeys];
const deletePromises = finalDeleteKeys.map((key) => this.keys(key).then(this.del));

@@ -68,0 +76,0 @@ yield Promise.all(deletePromises);

{
"name": "@type-cacheable/lru-cache-adapter",
"version": "8.0.5",
"version": "9.0.1",
"description": "Adapter for using lru-cache with type-cacheable",

@@ -38,2 +38,3 @@ "main": "dist/index.js",

"devDependencies": {
"@type-cacheable/core": "^9.0.1",
"@types/jest": "^26.0.0",

@@ -45,8 +46,6 @@ "@types/lru-cache": "^5.1.0",

"peerDependencies": {
"@type-cacheable/core": "^8.0.5",
"lru-cache": "^6.0.0"
},
"dependencies": {
"@type-cacheable/core": "^8.0.5"
},
"gitHead": "7ac5ff2c0b600938d7f7ae879b16ee36b169cf7e"
"gitHead": "b667a76bdef5ae84d5d4cac1fef6c9721e00c3cb"
}

@@ -31,2 +31,2 @@ # @type-cacheable/lru-cache-adapter

Then you can rely on the `@Cacheable`, `@CacheUpdate`, and `@CacheClear` decorators from `@type-cacheable/core`. [See core documentation](https://github.com/joshuaslate/type-cacheable/tree/master/packages/core)
Then you can rely on the `@Cacheable`, `@CacheUpdate`, and `@CacheClear` decorators from `@type-cacheable/core`. [See core documentation](https://github.com/joshuaslate/type-cacheable/tree/main/packages/core)

Sorry, the diff of this file is not supported yet

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