(key: K, defaultValue: V)
| 82 | } |
| 83 | |
| 84 | getOrInsert(key: K, defaultValue: V): V { |
| 85 | if (this.cache.has(key)) { |
| 86 | this.updateKeyUsage(key) |
| 87 | return this.cache.get(key)! |
| 88 | } |
| 89 | this.set(key, defaultValue) |
| 90 | return defaultValue |
| 91 | } |
| 92 | |
| 93 | getOrInsertComputed(key: K, callback: (key: K) => V): V { |
| 94 | if (this.cache.has(key)) { |
nothing calls this directly
no test coverage detected