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

Function augmentItemWithIncludeMetadata

deps/npm/lib/commands/ls.js:264–279  ·  view source on GitHub ↗
(node, item)

Source from the content-addressed store, hash-verified

262
263// annotates _parent and _include metadata into the resulting item obj allowing for filtering out results during output
264const augmentItemWithIncludeMetadata = (node, item) => {
265 item[_parent] = node[_parent]
266 item[_include] = node[_include]
267
268 // append current item to its parent.nodes which is the structure expected by archy in order to print tree
269 if (node[_include]) {
270 // includes all ancestors of included node
271 let p = node[_parent]
272 while (p) {
273 p[_include] = true
274 p = p[_parent]
275 }
276 }
277
278 return item
279}
280
281const getHumanOutputItem = (node, { args, chalk, global, long }) => {
282 const { pkgid, path } = node

Callers 2

getHumanOutputItemFunction · 0.85
getJsonOutputItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected