MCPcopy
hub / github.com/webpack/webpack / processCapturedFiles

Method processCapturedFiles

lib/FileSystemInfo.js:2618–2705  ·  lib/FileSystemInfo.js::FileSystemInfo.processCapturedFiles
(capturedFiles)

Source from the content-addressed store, hash-verified

2616 * @param {ManagedFiles} capturedFiles captured files
2617 */
2618 const processCapturedFiles = (capturedFiles) => {
2619 if (capturedFiles.size === 0) {
2620 return;
2621 }
2622 switch (mode) {
2623 case 3:
2624 this._fileTshsOptimization.optimize(snapshot, capturedFiles);
2625 for (const path of capturedFiles) {
2626 const cache = this._fileTshs.get(path);
2627 if (cache !== undefined) {
2628 fileTshs.set(path, cache);
2629 } else {
2630 jobs++;
2631 this._getFileTimestampAndHash(path, (err, entry) => {
2632 if (err) {
2633 if (this.logger) {
2634 this.logger.debug(
2635 `Error snapshotting file timestamp hash combination of ${path}: ${err.stack}`
2636 );
2637 }
2638 jobError();
2639 } else {
2640 fileTshs.set(path, /** @type {TimestampAndHash} */ (entry));
2641 jobDone();
2642 }
2643 });
2644 }
2645 }
2646 break;
2647 case 2:
2648 this._fileHashesOptimization.optimize(snapshot, capturedFiles);
2649 for (const path of capturedFiles) {
2650 const cache = this._fileHashes.get(path);
2651 if (cache !== undefined) {
2652 fileHashes.set(path, cache);
2653 } else {
2654 jobs++;
2655 this.fileHashQueue.add(path, (err, entry) => {
2656 if (err) {
2657 if (this.logger) {
2658 this.logger.debug(
2659 `Error snapshotting file hash of ${path}: ${err.stack}`
2660 );
2661 }
2662 jobError();
2663 } else {
2664 fileHashes.set(path, /** @type {string} */ (entry));
2665 jobDone();
2666 }
2667 });
2668 }
2669 }
2670 break;
2671 case 1:
2672 this._fileTimestampsOptimization.optimize(snapshot, capturedFiles);
2673 for (const path of capturedFiles) {
2674 const cache = this._fileTimestamps.get(path);
2675 if (cache !== undefined && !isExistenceOnly(cache)) {

Callers

nothing calls this directly

Calls 7

isExistenceOnlyFunction · 0.85
optimizeMethod · 0.80
debugMethod · 0.80
getMethod · 0.45
setMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected