MCPcopy Create free account
hub / github.com/formkit/formkit / getDependencyTree

Function getDependencyTree

scripts/utils.mjs:144–158  ·  view source on GitHub ↗
(packages, inverse = false)

Source from the content-addressed store, hash-verified

142 * the result will be the depenDENT tree instead.
143 */
144export async function getDependencyTree(packages, inverse = false) {
145 const tree = []
146 const allPackages = await getPackages()
147 for (const pkg of packages) {
148 const dependencies = []
149 for (const ap of allPackages) {
150 if (inverse ? checkDependsOn(ap, pkg) : checkDependsOn(pkg, ap)) {
151 const subDependencies = await getDependencyTree([ap], tree, inverse)
152 dependencies.push(...subDependencies)
153 }
154 }
155 tree.push([pkg, dependencies.length ? dependencies : false])
156 }
157 return tree
158}
159
160/**
161 * Given a dependency tree, produce a flat array of package names in order

Callers 4

publishPackagesFunction · 0.90
getPublishOrderFunction · 0.90
publishPackagesFunction · 0.90
getPublishOrderFunction · 0.90

Calls 2

getPackagesFunction · 0.85
checkDependsOnFunction · 0.85

Tested by

no test coverage detected