MCPcopy
hub / github.com/tdewolff/minify / makeDepndencyGraph

Function makeDepndencyGraph

_benchmarks/sample_echarts.js:15758–15787  ·  view source on GitHub ↗
(fullNameList)

Source from the content-addressed store, hash-verified

15756 };
15757
15758 function makeDepndencyGraph(fullNameList) {
15759 var graph = {};
15760 var noEntryList = [];
15761 each(fullNameList, function (name) {
15762 var thisItem = createDependencyGraphItem(graph, name);
15763 var originalDeps = thisItem.originalDeps = dependencyGetter(name);
15764 var availableDeps = getAvailableDependencies(originalDeps, fullNameList);
15765 thisItem.entryCount = availableDeps.length;
15766
15767 if (thisItem.entryCount === 0) {
15768 noEntryList.push(name);
15769 }
15770
15771 each(availableDeps, function (dependentName) {
15772 if (indexOf(thisItem.predecessor, dependentName) < 0) {
15773 thisItem.predecessor.push(dependentName);
15774 }
15775
15776 var thatItem = createDependencyGraphItem(graph, dependentName);
15777
15778 if (indexOf(thatItem.successor, dependentName) < 0) {
15779 thatItem.successor.push(name);
15780 }
15781 });
15782 });
15783 return {
15784 graph: graph,
15785 noEntryList: noEntryList
15786 };
15787 }
15788
15789 function createDependencyGraphItem(graph, name) {
15790 if (!graph[name]) {

Callers 1

enableTopologicalTravelFunction · 0.85

Calls 4

getAvailableDependenciesFunction · 0.85
eachFunction · 0.70
indexOfFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…