MCPcopy
hub / github.com/formatjs/formatjs / visitDependents

Function visitDependents

tools/release-please/npm-workspace-graph.ts:164–186  ·  view source on GitHub ↗
(
  graph: DependencyGraph,
  name: string,
  visited: Set<WorkspacePackage>,
  path: string[]
)

Source from the content-addressed store, hash-verified

162}
163
164function visitDependents(
165 graph: DependencyGraph,
166 name: string,
167 visited: Set<WorkspacePackage>,
168 path: string[]
169) {
170 if (path.includes(name)) {
171 throw new Error(
172 `found cycle in dependency graph: ${path.join(' -> ')} -> ${name}`
173 )
174 }
175
176 const node = graph.get(name)
177 if (!node) {
178 return
179 }
180
181 const nextPath = path.concat(name)
182 for (const depName of node.deps) {
183 visitDependents(graph, depName, visited, nextPath)
184 }
185 visited.add(node.value)
186}
187
188export function dependentPackageOrder(
189 graph: DependencyGraph,

Callers 1

dependentPackageOrderFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected