@cacheable/node-cache
Advanced tools
Comparing version
@@ -238,3 +238,3 @@ import { Hookified } from 'hookified'; | ||
*/ | ||
get<T>(key: string | number): any; | ||
get<T>(key: string | number): T | undefined; | ||
/** | ||
@@ -244,5 +244,5 @@ * Gets multiple saved values from the cache. Returns an empty object {} if not found or expired. | ||
* @param {Array<string | number} keys an array of keys | ||
* @returns {Record<string, unknown>} an object with the key as a property and the value as the value | ||
* @returns {Record<string, T | undefined>} an object with the key as a property and the value as the value | ||
*/ | ||
mget<T>(keys: Array<string | number>): Record<string, unknown>; | ||
mget<T>(keys: Array<string | number>): Record<string, T | undefined>; | ||
/** | ||
@@ -249,0 +249,0 @@ * Get the cached value and remove the key from the cache. Equivalent to calling get(key) + del(key). |
@@ -260,3 +260,3 @@ // src/index.ts | ||
if (this.options.maxKeys) { | ||
const maxKeys = this.options.maxKeys; | ||
const { maxKeys } = this.options; | ||
if (maxKeys > -1 && this.store.size >= maxKeys) { | ||
@@ -323,3 +323,3 @@ throw this.createError("Cache max keys amount exceeded" /* ECACHEFULL */, this.formatKey(key)); | ||
* @param {Array<string | number} keys an array of keys | ||
* @returns {Record<string, unknown>} an object with the key as a property and the value as the value | ||
* @returns {Record<string, T | undefined>} an object with the key as a property and the value as the value | ||
*/ | ||
@@ -500,3 +500,3 @@ mget(keys) { | ||
this.checkData(); | ||
}, checkPeriodinSeconds); | ||
}, checkPeriodinSeconds).unref(); | ||
return; | ||
@@ -503,0 +503,0 @@ } |
{ | ||
"name": "@cacheable/node-cache", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"description": "Simple and Maintained fast NodeJS internal caching", | ||
@@ -34,14 +34,14 @@ "type": "module", | ||
"devDependencies": { | ||
"@types/node": "^22.15.7", | ||
"@vitest/coverage-v8": "^3.1.3", | ||
"@types/node": "^22.15.30", | ||
"@vitest/coverage-v8": "^3.2.2", | ||
"rimraf": "^6.0.1", | ||
"tsup": "^8.4.0", | ||
"tsup": "^8.5.0", | ||
"typescript": "^5.8.3", | ||
"vitest": "^3.1.3", | ||
"xo": "^0.60.0" | ||
"vitest": "^3.2.2", | ||
"xo": "^1.1.0" | ||
}, | ||
"dependencies": { | ||
"hookified": "^1.8.2", | ||
"hookified": "^1.9.1", | ||
"keyv": "^5.3.3", | ||
"cacheable": "^1.9.0" | ||
"cacheable": "^1.10.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
70865
0.09%Updated
Updated