MCPcopy Create free account
hub / github.com/nodejs/node / visit

Method visit

deps/npm/lib/commands/ls.js:151–171  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

149 },
150 // visit each `node` of the `tree`, returning an `item` - these are the elements that will be used to build the final output
151 visit (node) {
152 node[_problems] = getProblems(node, { global })
153
154 const item = json
155 ? getJsonOutputItem(node, { global, long })
156 : parseable
157 ? null
158 : getHumanOutputItem(node, { args, chalk, global, long })
159
160 // loop through list of node problems to add them to global list
161 if (node[_include]) {
162 for (const problem of node[_problems]) {
163 problems.add(problem)
164 }
165 }
166
167 seenItems.add(item)
168
169 // return a promise so we don't blow the stack
170 return Promise.resolve(item)
171 },
172 })
173
174 // handle the special case of a broken package.json in the root folder

Callers

nothing calls this directly

Calls 5

getProblemsFunction · 0.85
getJsonOutputItemFunction · 0.85
getHumanOutputItemFunction · 0.85
addMethod · 0.65
resolveMethod · 0.45

Tested by

no test coverage detected