MCPcopy
hub / github.com/webpack/webpack / add

Method add

lib/optimize/RealContentHashPlugin.js:358–376  ·  lib/optimize/RealContentHashPlugin.js::RealContentHashPlugin.add
(hash, stack)

Source from the content-addressed store, hash-verified

356 * @param {Set<string>} stack stack of hashes
357 */
358 const add = (hash, stack) => {
359 const deps = getDependencies(hash);
360 if (!deps) return;
361 stack.add(hash);
362 for (const dep of deps) {
363 if (hashesInOrder.has(dep)) continue;
364 if (stack.has(dep)) {
365 throw new Error(
366 `Circular hash dependency ${Array.from(
367 stack,
368 hashInfo
369 ).join(class="st">" -> ")} -> ${hashInfo(dep)}`
370 );
371 }
372 add(dep, stack);
373 }
374 hashesInOrder.add(hash);
375 stack.delete(hash);
376 };
377 if (hashesInOrder.has(hash)) continue;
378 add(hash, new Set());
379 }

Callers 15

applyMethod · 0.45
applySplitMethod · 0.45
handlerMethod · 0.45
addToListFunction · 0.45
applyMethod · 0.45
getDependenciesMethod · 0.45
handlerMethod · 0.45
applyMethod · 0.45
addToSetMapFunction · 0.45
applyMethod · 0.45
enableInlineExportsFunction · 0.45
handlerMethod · 0.45

Calls 3

addFunction · 0.50
hasMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected