()
| 15 | } |
| 16 | |
| 17 | function evictOverflowEntries(): void { |
| 18 | while (IMAGE_CACHE.size > imageCacheMaxEntries) { |
| 19 | const oldest = IMAGE_CACHE.keys().next(); |
| 20 | if (oldest.done) return; |
| 21 | IMAGE_CACHE.delete(oldest.value); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | export function setImageCacheMaxEntries(maxEntries: number): void { |
| 26 | imageCacheMaxEntries = normalizeCacheMaxEntries(maxEntries); |
no test coverage detected