* Same as `readFresh`, but reads from the cache instead of transforming * the file from source. This has the benefit of being synchronous. As a * result it is possible to read many cached Module in a row, synchronously.
(transformOptions: TransformOptions)
| 340 | * result it is possible to read many cached Module in a row, synchronously. |
| 341 | */ |
| 342 | readCached(transformOptions: TransformOptions): CachedReadResult { |
| 343 | const key = stableObjectHash(transformOptions || {}); |
| 344 | let result = this._readResultsByOptionsKey.get(key); |
| 345 | if (result != null) { |
| 346 | return result; |
| 347 | } |
| 348 | result = this._readFromTransformCache(transformOptions, key); |
| 349 | this._readResultsByOptionsKey.set(key, result); |
| 350 | return result; |
| 351 | } |
| 352 | |
| 353 | /** |
| 354 | * Read again from the TransformCache, on disk. `readCached` should be favored |
no test coverage detected