MCPcopy Create free account
hub / github.com/npm/cli / parseGraph

Function parseGraph

workspaces/arborist/test/isolated-mode.js:2823–2832  ·  view source on GitHub ↗
(graph)

Source from the content-addressed store, hash-verified

2821}
2822
2823function parseGraph (graph) {
2824 const root = Object.entries(graph).find(([key]) => key.includes('(root)'))
2825 const result = { root: parseGraphRecursive(...root), workspaces: [] }
2826
2827 Object.entries(graph).filter(([key]) => key.includes('(workspace)'))
2828 .forEach(([key, value]) => {
2829 result.workspaces.push(parseGraphRecursive(key, value))
2830 })
2831 return result
2832}
2833
2834function isLoopToken (obj) {
2835 return typeof obj === 'string' && /^\(back \d+\)$/.test(obj)

Callers 1

isolated-mode.jsFile · 0.85

Calls 4

parseGraphRecursiveFunction · 0.85
findMethod · 0.80
filterMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected