(key: K, create: () => V)
| 13 | } |
| 14 | |
| 15 | getOrCreate(key: K, create: () => V): V { |
| 16 | const cached = this._map.get(key) |
| 17 | if (cached) { |
| 18 | return cached.value |
| 19 | } |
| 20 | const value = create() |
| 21 | this.set(key, value) |
| 22 | return value |
| 23 | } |
| 24 | } |
no test coverage detected