(maxEntries: number)
| 6 | let imageCacheMaxEntries = DEFAULT_IMAGE_CACHE_MAX_ENTRIES; |
| 7 | |
| 8 | function normalizeCacheMaxEntries(maxEntries: number): number { |
| 9 | if (!Number.isFinite(maxEntries) || !Number.isInteger(maxEntries) || maxEntries < 0) { |
| 10 | throw new TypeError( |
| 11 | "setImageCacheMaxEntries(maxEntries): maxEntries must be a non-negative integer", |
| 12 | ); |
| 13 | } |
| 14 | return maxEntries; |
| 15 | } |
| 16 | |
| 17 | function evictOverflowEntries(): void { |
| 18 | while (IMAGE_CACHE.size > imageCacheMaxEntries) { |
no outgoing calls
no test coverage detected