(config?: ClientSideCacheConfig)
| 512 | } |
| 513 | |
| 514 | constructor(config?: ClientSideCacheConfig) { |
| 515 | super(); |
| 516 | |
| 517 | this.#cacheKeyToEntryMap = new Map<string, ClientSideCacheEntry>(); |
| 518 | this.#keyToCacheKeySetMap = new Map<string, Set<string>>(); |
| 519 | this.ttl = config?.ttl ?? 0; |
| 520 | this.maxEntries = config?.maxEntries ?? 0; |
| 521 | this.lru = config?.evictPolicy !== "FIFO"; |
| 522 | |
| 523 | const recordStats = config?.recordStats !== false; |
| 524 | this.#statsCounter = recordStats ? DefaultStatsCounter.create() : disabledStatsCounter(); |
| 525 | } |
| 526 | |
| 527 | /* logic of how caching works: |
| 528 |
nothing calls this directly
no test coverage detected