()
| 39 | } |
| 40 | |
| 41 | const prune = () => { |
| 42 | if (options.maxEntries === undefined) return |
| 43 | while (store.size > options.maxEntries) { |
| 44 | const key = store.keys().next().value |
| 45 | if (!key) return |
| 46 | const entry = store.get(key) |
| 47 | store.delete(key) |
| 48 | if (!entry) continue |
| 49 | dispose(key, entry) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | const remove = (key: string) => { |
| 54 | const entry = store.get(key) |