(key: string)
| 79 | this.cache = new Map(); |
| 80 | } |
| 81 | public get(key: string) { |
| 82 | const result = this.cache.get(key); |
| 83 | if (result) { |
| 84 | return result; |
| 85 | } else { |
| 86 | throw new Error( |
| 87 | `No entry found in memory cache when one was expected: ${key}`, |
| 88 | ); |
| 89 | } |
| 90 | } |
| 91 | public set(key: string, value: any) { |
| 92 | this.cache.set(key, value); |
| 93 | } |