* Sets the specified key to the specified value. * * @param key The key to set the value for. * @param value The value to set. * @returns `this` for chaining. * * @example Setting a value in the cache * ```ts no-assert * import { LruCache } from "@std/cache"; * * const
(key: K, value: V)
| 262 | * ``` |
| 263 | */ |
| 264 | override set(key: K, value: V): this { |
| 265 | if (this.#ejecting) { |
| 266 | throw new TypeError( |
| 267 | "Cannot set entry in LruCache: cache is not re-entrant during onEject callbacks", |
| 268 | ); |
| 269 | } |
| 270 | this.#setMostRecentlyUsed(key, value); |
| 271 | this.#pruneToMaxSize(); |
| 272 | |
| 273 | return this; |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * Deletes the value associated with the given key. |
nothing calls this directly
no test coverage detected