* @param {string} hash * @return {null|Promise }
(hash)
| 32 | * @return {null|Promise<T>} |
| 33 | */ |
| 34 | get(hash) { |
| 35 | const cached = this.transformMap.get(hash); |
| 36 | if (cached) { |
| 37 | return cached; |
| 38 | } |
| 39 | |
| 40 | const filename = this.key_(hash); |
| 41 | if (this.fsCache.has(filename)) { |
| 42 | const persisted = fs.readJson(path.join(this.cacheDir, filename)); |
| 43 | this.transformMap.set(hash, persisted); |
| 44 | return persisted; |
| 45 | } |
| 46 | |
| 47 | return null; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @param {string} hash |
no test coverage detected