(key: K)
| 15 | } |
| 16 | |
| 17 | get(key: K): V | undefined { |
| 18 | const value = this.cache.get(key); |
| 19 | if (value) { |
| 20 | // Move to end to mark as recently used |
| 21 | this.cache.delete(key); |
| 22 | this.cache.set(key, value); |
| 23 | } |
| 24 | return value; |
| 25 | } |
| 26 | |
| 27 | set(key: K, value: V): void { |
| 28 | if (this.cache.has(key)) { |
no test coverage detected