MCPcopy
hub / github.com/jestjs/jest / callback

Function callback

packages/jest-haste-map/src/crawlers/node.ts:212–233  ·  view source on GitHub ↗
(list: Result)

Source from the content-addressed store, hash-verified

210
211 return new Promise(resolve => {
212 const callback = (list: Result) => {
213 const files = new Map();
214 const removedFiles = new Map(data.files);
215 for (const fileData of list) {
216 const [filePath, mtime, size] = fileData;
217 const relativeFilePath = fastPath.relative(rootDir, filePath);
218 const existingFile = data.files.get(relativeFilePath);
219 if (existingFile && existingFile[H.MTIME] === mtime) {
220 files.set(relativeFilePath, existingFile);
221 } else {
222 // See ../constants.js; SHA-1 will always be null and fulfilled later.
223 files.set(relativeFilePath, ['', mtime, size, 0, '', null]);
224 }
225 removedFiles.delete(relativeFilePath);
226 }
227 data.files = files;
228
229 resolve({
230 hasteMap: data,
231 removedFiles,
232 });
233 };
234
235 if (useNativeFind) {
236 findNative(roots, extensions, ignore, enableSymlinks, callback);

Callers 15

searchFunction · 0.70
findFunction · 0.70
findNativeFunction · 0.70
matchErrorSnapshotFunction · 0.50
worker_farm.jsFile · 0.50
writeFunction · 0.50
notifyMockGeneratedMethod · 0.50
detectChangedFileMethod · 0.50
normalizeProxyFunction · 0.50
normalizeProxyMethod · 0.50
closeMethod · 0.50
node.test.jsFile · 0.50

Calls 4

deleteMethod · 0.80
resolveFunction · 0.50
getMethod · 0.45
setMethod · 0.45

Tested by 5

matchErrorSnapshotFunction · 0.40
writeFunction · 0.40
statFunction · 0.40
toCustomMatchFunction · 0.40
toCustomMatchFunction · 0.40