You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

cacheable

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cacheable - npm Package Compare versions

Comparing version
1.8.9
to
1.8.10
+14
-2
dist/index.cjs

@@ -1383,4 +1383,16 @@ "use strict";

result = rawResult.value;
const finalTtl = rawResult.expires ?? void 0;
await this._primary.set(key, result, finalTtl);
let finalTtl;
let expired = false;
if (rawResult.expires) {
const now = Date.now();
finalTtl = rawResult.expires - now;
if (finalTtl <= 0) {
expired = true;
}
}
if (expired) {
result = void 0;
} else {
await this._primary.set(key, result, finalTtl);
}
}

@@ -1387,0 +1399,0 @@ }

@@ -1342,4 +1342,16 @@ // src/index.ts

result = rawResult.value;
const finalTtl = rawResult.expires ?? void 0;
await this._primary.set(key, result, finalTtl);
let finalTtl;
let expired = false;
if (rawResult.expires) {
const now = Date.now();
finalTtl = rawResult.expires - now;
if (finalTtl <= 0) {
expired = true;
}
}
if (expired) {
result = void 0;
} else {
await this._primary.set(key, result, finalTtl);
}
}

@@ -1346,0 +1358,0 @@ }

+9
-9
{
"name": "cacheable",
"version": "1.8.9",
"version": "1.8.10",
"description": "High Performance Layer 1 / Layer 2 Caching with Keyv Storage",

@@ -24,16 +24,16 @@ "type": "module",

"devDependencies": {
"@faker-js/faker": "^9.5.1",
"@keyv/redis": "^4.3.1",
"@types/node": "^22.13.9",
"@vitest/coverage-v8": "^3.0.7",
"lru-cache": "^11.0.2",
"@faker-js/faker": "^9.6.0",
"@keyv/redis": "^4.3.2",
"@types/node": "^22.14.0",
"@vitest/coverage-v8": "^3.1.1",
"lru-cache": "^11.1.0",
"rimraf": "^6.0.1",
"tsup": "^8.4.0",
"typescript": "^5.8.2",
"vitest": "^3.0.7",
"vitest": "^3.1.1",
"xo": "^0.60.0"
},
"dependencies": {
"hookified": "^1.7.1",
"keyv": "^5.3.1"
"hookified": "^1.8.1",
"keyv": "^5.3.2"
},

@@ -40,0 +40,0 @@ "keywords": [