MCPcopy
hub / github.com/TheAlgorithms/JavaScript / parse

Method parse

Cache/LRUCache.js:112–123  ·  view source on GitHub ↗

* @param {JSON} json * @returns {LRUCache}

(json)

Source from the content-addressed store, hash-verified

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

Callers 2

LFUCache.test.jsFile · 0.45
LRUCache.test.jsFile · 0.45

Calls 1

setMethod · 0.95

Tested by

no test coverage detected