MCPcopy Create free account
hub / github.com/adobe/react-spectrum / writeCacheFile

Function writeCacheFile

lib/jestResolver.js:101–112  ·  view source on GitHub ↗
(cacheFile, res)

Source from the content-addressed store, hash-verified

99};
100
101function writeCacheFile(cacheFile, res) {
102 // If cache file already exists, return it.
103 if (fs.existsSync(cacheFile)) {
104 return cacheFile;
105 }
106
107 // Otherwise, write it atomically to avoid race conditions between threads/processes.
108 let tmpFile = cacheFile + '.' + process.pid + (threadId != null ? '.' + threadId : '');
109 fs.writeFileSync(tmpFile, res);
110 fs.renameSync(tmpFile, cacheFile);
111 return cacheFile;
112}
113
114function processExports(exports) {
115 for (let key in exports) {

Callers 1

jestResolver.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected