* @param {number} indent * @returns {JSON} - string
(indent)
| 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 | |
| 146 | export default LRUCache |
no outgoing calls