diff --git a/lib/cache/memory-cache-store.js b/lib/cache/memory-cache-store.js index 6a00568ca22..0b099b67342 100644 --- a/lib/cache/memory-cache-store.js +++ b/lib/cache/memory-cache-store.js @@ -13,7 +13,7 @@ const { Writable } = require('node:stream') * }} MemoryStoreValue */ class MemoryCacheStore { - #maxEntries = Infinity + #maxEntriesCount = Infinity #maxEntrySize = Infinity @@ -33,15 +33,15 @@ class MemoryCacheStore { throw new TypeError('MemoryCacheStore options must be an object') } - if (opts.maxEntries !== undefined) { + if (opts.maxEntriesCount !== undefined) { if ( - typeof opts.maxEntries !== 'number' || - !Number.isInteger(opts.maxEntries) || - opts.maxEntries < 0 + typeof opts.maxEntriesCount !== 'number' || + !Number.isInteger(opts.maxEntriesCount) || + opts.maxEntriesCount < 0 ) { - throw new TypeError('MemoryCacheStore options.maxEntries must be a non-negative integer') + throw new TypeError('MemoryCacheStore options.maxEntriesCount must be a non-negative integer') } - this.#maxEntries = opts.maxEntries + this.#maxEntriesCount = opts.maxEntriesCount } if (opts.maxEntrySize !== undefined) { @@ -58,7 +58,7 @@ class MemoryCacheStore { } get isFull () { - return this.#entryCount >= this.#maxEntries + return this.#entryCount >= this.#maxEntriesCount } /** diff --git a/types/cache-interceptor.d.ts b/types/cache-interceptor.d.ts index 1c30b42d359..c1d4476782f 100644 --- a/types/cache-interceptor.d.ts +++ b/types/cache-interceptor.d.ts @@ -77,7 +77,7 @@ declare namespace CacheHandler { /** * @default Infinity */ - maxEntries?: number + maxEntriesCount?: number /** * @default Infinity */