(
cacheProps: ReadTransformProps,
callback: (error: ?Error, result: ?TransformedCode) => void,
)
| 285 | } |
| 286 | |
| 287 | _getTransformedCode( |
| 288 | cacheProps: ReadTransformProps, |
| 289 | callback: (error: ?Error, result: ?TransformedCode) => void, |
| 290 | ) { |
| 291 | const {_globalCache} = this; |
| 292 | if (_globalCache == null || !_globalCache.shouldFetch(cacheProps)) { |
| 293 | this._transformCodeForCallback(cacheProps, callback); |
| 294 | return; |
| 295 | } |
| 296 | _globalCache.fetch(cacheProps).then( |
| 297 | globalCachedResult => process.nextTick(() => { |
| 298 | if (globalCachedResult == null) { |
| 299 | this._transformAndStoreCodeGlobally(cacheProps, _globalCache, callback); |
| 300 | return; |
| 301 | } |
| 302 | callback(undefined, globalCachedResult); |
| 303 | }), |
| 304 | globalCacheError => process.nextTick(() => callback(globalCacheError)), |
| 305 | ); |
| 306 | } |
| 307 | |
| 308 | _getAndCacheTransformedCode( |
| 309 | cacheProps: ReadTransformProps, |
no test coverage detected