MCPcopy Index your code
hub / github.com/tensorflow/tfjs / findSubgraph

Function findSubgraph

scripts/graph_utils.ts:116–128  ·  view source on GitHub ↗
(node: string, graph: Graph, subnodes = new Set())

Source from the content-addressed store, hash-verified

114 * closure at `node`.
115 */
116export function findSubgraph(node: string, graph: Graph, subnodes = new Set()) {
117 const directSubnodes = graph[node];
118 if (directSubnodes) {
119 for (const directSubnode of directSubnodes) {
120 if (!subnodes.has(directSubnode)) {
121 subnodes.add(directSubnode);
122 findSubgraph(directSubnode, graph, subnodes);
123 }
124 }
125 }
126
127 return subnodes;
128}
129
130/**
131 * Find the transitive closure of dependencies of the given packages.

Callers 2

findDepsFunction · 0.85
findReverseDepsFunction · 0.85

Calls 2

hasMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…