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

Method pendingSummary

lib/utils/allow-scripts-cmd.js:167–180  ·  view source on GitHub ↗
(unreviewed)

Source from the content-addressed store, hash-verified

165 // but tag every entry as `pending` since nothing is written. Names and
166 // versions are derived exactly like the text listing above.
167 pendingSummary (unreviewed) {
168 const groups = new Map()
169 for (const { node } of unreviewed) {
170 const { name, version } = trustedDisplay(node)
171 /* istanbul ignore next: every test node has a name */
172 const display = name || '<unknown>'
173 const key = version ? `${display}@${version}` : display
174 if (!groups.has(display)) {
175 groups.set(display, [])
176 }
177 groups.get(display).push({ key, change: 'pending' })
178 }
179 return [...groups].map(([name, changes]) => ({ name, changes }))
180 }
181
182 async runAll (unreviewed) {
183 if (unreviewed.length === 0) {

Callers 1

runPendingMethod · 0.95

Calls 5

trustedDisplayFunction · 0.85
pushMethod · 0.80
hasMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected