MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / _readFromTransformCache

Method _readFromTransformCache

packager/src/node-haste/Module.js:357–370  ·  view source on GitHub ↗

* Read again from the TransformCache, on disk. `readCached` should be favored * so it's faster in case the results are already in memory.

(
    transformOptions: TransformOptions,
    transformOptionsKey: string,
  )

Source from the content-addressed store, hash-verified

355 * so it's faster in case the results are already in memory.
356 */
357 _readFromTransformCache(
358 transformOptions: TransformOptions,
359 transformOptionsKey: string,
360 ): CachedReadResult {
361 const cacheProps = this._getCacheProps(transformOptions, transformOptionsKey);
362 const cachedResult = TransformCache.readSync(cacheProps);
363 if (cachedResult.result == null) {
364 return {result: null, outdatedDependencies: cachedResult.outdatedDependencies};
365 }
366 return {
367 result: this._finalizeReadResult(cacheProps.sourceCode, cachedResult.result),
368 outdatedDependencies: [],
369 };
370 }
371
372 /**
373 * Gathers relevant data about a module: source code, transformed code,

Callers 1

readCachedMethod · 0.95

Calls 2

_getCachePropsMethod · 0.95
_finalizeReadResultMethod · 0.95

Tested by

no test coverage detected