MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / toString

Method toString

Cache/LRUCache.js:129–143  ·  view source on GitHub ↗

* @param {number} indent * @returns {JSON} - string

(indent)

Source from the content-addressed store, hash-verified

127 * @returns {JSON} - string
128 */
129 toString(indent) {
130 const replacer = (_, value) => {
131 if (value instanceof Set) {
132 return [...value]
133 }
134
135 if (value instanceof Map) {
136 return Object.fromEntries(value)
137 }
138
139 return value
140 }
141
142 return JSON.stringify(this, replacer, indent)
143 }
144}
145
146export default LRUCache

Callers 15

LFUCache.test.jsFile · 0.45
LRUCache.test.jsFile · 0.45
toHexFunction · 0.45
PrimMSTMethod · 0.45
DFSComponentMethod · 0.45
connectedComponentsMethod · 0.45
preProcessFunction · 0.45
SHA1Function · 0.45

Calls

no outgoing calls

Tested by 1

hexMD5Function · 0.36