diff --git a/package-lock.json b/package-lock.json index 950b6421..1aa247fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8206,9 +8206,9 @@ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "node_modules/lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "engines": { "node": ">=12" } @@ -16715,9 +16715,9 @@ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "lru-cache": { - "version": "7.13.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", - "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==" + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==" }, "make-dir": { "version": "3.1.0", diff --git a/src/cache/storage/memory-storage-adapter.ts b/src/cache/storage/memory-storage-adapter.ts index e8c485b1..4c32753b 100644 --- a/src/cache/storage/memory-storage-adapter.ts +++ b/src/cache/storage/memory-storage-adapter.ts @@ -21,8 +21,11 @@ export class MemoryStorageAdapter implements StorageAdapter { } public async get(key: string): Promise { - const cached = await this.cache.get(key); - return cached ?? null; + if (this.cache.has(key)) { + return this.cache.get(key) as T; + } + + return null; } public async set(key: string, value: T): Promise { @@ -30,6 +33,6 @@ export class MemoryStorageAdapter implements StorageAdapter { } public async delete(key: string): Promise { - this.cache.del(key); + this.cache.delete(key); } }