(key)
| 350 | } |
| 351 | |
| 352 | get(key) { |
| 353 | this.rotate(); |
| 354 | if (key in this.cache) { |
| 355 | return this.cache[key]; |
| 356 | } else if (key in this.previous) { |
| 357 | this.cache[key] = this.previous[key]; |
| 358 | delete this.previous[key]; |
| 359 | return this.cache[key]; |
| 360 | } else { |
| 361 | return null; |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | rotate(force) { |
| 366 | if (force == null) force = false; |
no test coverage detected