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

Function detectErrors

deps/npm/lib/commands/sbom.js:110–128  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

108}
109
110const detectErrors = (node) => {
111 const errors = []
112
113 // Look for missing dependencies (that are NOT optional), or invalid dependencies
114 for (const edge of node.edgesOut.values()) {
115 if (edge.missing && !(edge.type === 'optional' || edge.type === 'peerOptional')) {
116 errors.push(`missing: ${edge.name}@${edge.spec}, required by ${edge.from.pkgid}`)
117 }
118
119 if (edge.invalid) {
120 /* istanbul ignore next */
121 const spec = edge.spec || '*'
122 const from = edge.from.pkgid
123 errors.push(`invalid: ${edge.to.pkgid}, ${spec} required by ${from}`)
124 }
125 }
126
127 return errors
128}
129
130module.exports = SBOM

Callers 1

execMethod · 0.85

Calls 2

valuesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected