MCPcopy Create free account
hub / github.com/SAP/ui5-project / _traverseDepthFirst

Method _traverseDepthFirst

lib/graph/ProjectGraph.js:458–476  ·  view source on GitHub ↗
(projectName, visited, ancestors, callback)

Source from the content-addressed store, hash-verified

456 }
457
458 async _traverseDepthFirst(projectName, visited, ancestors, callback) {
459 this._checkCycle(ancestors, projectName);
460
461 if (visited[projectName]) {
462 return visited[projectName];
463 }
464 return visited[projectName] = (async () => {
465 const newAncestors = [...ancestors, projectName];
466 const dependencies = this.getDependencies(projectName);
467 await Promise.all(dependencies.map((depName) => {
468 return this._traverseDepthFirst(depName, visited, newAncestors, callback);
469 }));
470
471 await callback({
472 project: this.getProject(projectName),
473 dependencies
474 });
475 })();
476 }
477
478 /**
479 * Join another project graph into this one.

Callers 1

traverseDepthFirstMethod · 0.95

Calls 3

_checkCycleMethod · 0.95
getDependenciesMethod · 0.95
getProjectMethod · 0.95

Tested by

no test coverage detected