()
| 12 | const assetBufferCache = new Map<string, Buffer>(); |
| 13 | |
| 14 | function trimAssetCache(): void { |
| 15 | if (assetBufferCache.size <= MAX_ASSET_CACHE_SIZE) return; |
| 16 | const excess = assetBufferCache.size - MAX_ASSET_CACHE_SIZE; |
| 17 | let count = 0; |
| 18 | for (const key of Array.from(assetBufferCache.keys())) { |
| 19 | if (count >= excess) break; |
| 20 | assetBufferCache.delete(key); |
| 21 | count++; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | interface RoleConfig { |
| 26 | x: number; |
no test coverage detected