MCPcopy Index your code
hub / github.com/ptmt/react-native-macos / _getTransformedCode

Method _getTransformedCode

packager/src/node-haste/Module.js:287–306  ·  view source on GitHub ↗
(
    cacheProps: ReadTransformProps,
    callback: (error: ?Error, result: ?TransformedCode) => void,
  )

Source from the content-addressed store, hash-verified

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,

Callers 1

Calls 6

shouldFetchMethod · 0.80
callbackFunction · 0.50
thenMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected