code: function collectTransitiveDependencies(
    collected,
    depGraph,
    fromName
  ) {
    const immediateDeps = depGraph[fromName];
    if (immediateDeps) {
      Object.keys(immediateDeps).forEach(toName => {
        if (!collected[toName]) {
          collected[toName] = true;
          collectTransitiveDependencies(collected, depGraph, toName);
        }
      });
    }
  }
docs: From a dependency graph, collects a list of transitive dependencies by recursing through a dependency graph.