(maxEntries: number, maxSizeBytes: number)
| 31 | private cache: LRUCache<string, FileState> |
| 32 | |
| 33 | constructor(maxEntries: number, maxSizeBytes: number) { |
| 34 | this.cache = new LRUCache<string, FileState>({ |
| 35 | max: maxEntries, |
| 36 | maxSize: maxSizeBytes, |
| 37 | sizeCalculation: value => Math.max(1, Buffer.byteLength(value.content)), |
| 38 | }) |
| 39 | } |
| 40 | |
| 41 | get(key: string): FileState | undefined { |
| 42 | return this.cache.get(normalize(key)) |