MCPcopy Create free account
hub / github.com/Kong/insomnia / packageForAbsPath

Function packageForAbsPath

scripts/circular-references/check-cycle-references.mjs:37–40  ·  view source on GitHub ↗
(absPath)

Source from the content-addressed store, hash-verified

35const packageNames = packageDirs.map(({ name }) => name);
36
37function packageForAbsPath(absPath) {
38 const found = packageDirs.find(({ dir }) => absPath === dir || absPath.startsWith(dir + path.sep));
39 return found ? found.name : null;
40}
41
42// Rotates a cycle's node list to start at its lexicographically smallest entry, so the same
43// logical cycle reported starting from different nodes (which dependency-cruiser does) collapses

Callers 1

cruisePackageFunction · 0.85

Calls 1

findMethod · 0.65

Tested by

no test coverage detected