MCPcopy
hub / github.com/webpack/webpack / _mergeWithCollected

Method _mergeWithCollected

lib/Watching.js:99–116  ·  view source on GitHub ↗

* Merge with collected. * @param {ReadonlySet<string> | undefined | null} changedFiles changed files * @param {ReadonlySet<string> | undefined | null} removedFiles removed files

(changedFiles, removedFiles)

Source from the content-addressed store, hash-verified

97 * @param {ReadonlySet<string> | undefined | null} removedFiles removed files
98 */
99 _mergeWithCollected(changedFiles, removedFiles) {
100 if (!changedFiles) return;
101 if (!this._collectedChangedFiles) {
102 this._collectedChangedFiles = new Set(changedFiles);
103 this._collectedRemovedFiles = new Set(removedFiles);
104 } else {
105 for (const file of changedFiles) {
106 this._collectedChangedFiles.add(file);
107 /** @type {CollectedFiles} */
108 (this._collectedRemovedFiles).delete(file);
109 }
110 for (const file of /** @type {ReadonlySet<string>} */ (removedFiles)) {
111 this._collectedChangedFiles.delete(file);
112 /** @type {CollectedFiles} */
113 (this._collectedRemovedFiles).add(file);
114 }
115 }
116 }
117
118 /**
119 * Processes the provided file time info entries.

Callers 2

_goMethod · 0.95
_invalidateMethod · 0.95

Calls 2

addMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected