* Gets the element with the specified key. * * @param key The key to get the value for. * @returns The value associated with the specified key, or `undefined` if * the key is not present in the cache. * * @example Getting a value from the cache * ```ts * import { LruCache } f
(key: K)
| 205 | * ``` |
| 206 | */ |
| 207 | override get(key: K): V | undefined { |
| 208 | if (super.has(key)) { |
| 209 | const value = super.get(key)!; |
| 210 | this.#setMostRecentlyUsed(key, value); |
| 211 | return value; |
| 212 | } |
| 213 | |
| 214 | return undefined; |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * Returns the value associated with the given key, or `undefined` if the |
nothing calls this directly
no test coverage detected