* @param {string} key * @param {*} value
(key, value)
| 74 | * @param {*} value |
| 75 | */ |
| 76 | set(key, value) { |
| 77 | key = String(key) |
| 78 | // Sets the value for the input key and if the key exists it updates the existing key |
| 79 | if (this.size === this.capacity) { |
| 80 | this.#removeLeastRecentlyUsed() |
| 81 | } |
| 82 | |
| 83 | this.cache.set(key, value) |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * @param {string} key |
no test coverage detected