* Get the entry for the key and mark it as used recently.
(key: string)
| 26 | * Get the entry for the key and mark it as used recently. |
| 27 | */ |
| 28 | public get(key: string): T { |
| 29 | let entry: T; |
| 30 | if (this.cache.has(key)) { |
| 31 | entry = this.cache.get(key); |
| 32 | this.cache.delete(key); |
| 33 | this.cache.set(key, entry); |
| 34 | } |
| 35 | return entry; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Put the entry into the cache. If the key already existed, mark the key as |
no test coverage detected