* @param {JSON} json * @returns {LRUCache}
(json)
| 110 | * @returns {LRUCache} |
| 111 | */ |
| 112 | parse(json) { |
| 113 | const { misses, hits, cache } = JSON.parse(json) |
| 114 | |
| 115 | this.misses += misses ?? 0 |
| 116 | this.hits += hits ?? 0 |
| 117 | |
| 118 | for (const key in cache) { |
| 119 | this.set(key, cache[key]) |
| 120 | } |
| 121 | |
| 122 | return this |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * @param {number} indent |
no test coverage detected