File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const { Writable } = require('node:stream')
1313 * }} MemoryStoreValue
1414 */
1515class MemoryCacheStore {
16- #maxEntries = Infinity
16+ #maxCount = Infinity
1717
1818 #maxEntrySize = Infinity
1919
@@ -33,15 +33,15 @@ class MemoryCacheStore {
3333 throw new TypeError ( 'MemoryCacheStore options must be an object' )
3434 }
3535
36- if ( opts . maxEntries !== undefined ) {
36+ if ( opts . maxCount !== undefined ) {
3737 if (
38- typeof opts . maxEntries !== 'number' ||
39- ! Number . isInteger ( opts . maxEntries ) ||
40- opts . maxEntries < 0
38+ typeof opts . maxCount !== 'number' ||
39+ ! Number . isInteger ( opts . maxCount ) ||
40+ opts . maxCount < 0
4141 ) {
42- throw new TypeError ( 'MemoryCacheStore options.maxEntries must be a non-negative integer' )
42+ throw new TypeError ( 'MemoryCacheStore options.maxCount must be a non-negative integer' )
4343 }
44- this . #maxEntries = opts . maxEntries
44+ this . #maxCount = opts . maxCount
4545 }
4646
4747 if ( opts . maxEntrySize !== undefined ) {
@@ -58,7 +58,7 @@ class MemoryCacheStore {
5858 }
5959
6060 get isFull ( ) {
61- return this . #entryCount >= this . #maxEntries
61+ return this . #entryCount >= this . #maxCount
6262 }
6363
6464 /**
Original file line number Diff line number Diff line change @@ -77,11 +77,13 @@ declare namespace CacheHandler {
7777 /**
7878 * @default Infinity
7979 */
80- maxEntries ?: number
80+ maxCount ?: number
81+
8182 /**
8283 * @default Infinity
8384 */
8485 maxEntrySize ?: number
86+
8587 errorCallback ?: ( err : Error ) => void
8688 }
8789
You can’t perform that action at this time.
0 commit comments