MCPcopy Create free account
hub / github.com/nodejs/node / #output

Method #output

deps/npm/lib/commands/access.js:203–223  ·  view source on GitHub ↗
(items, limiter)

Source from the content-addressed store, hash-verified

201 }
202
203 #output (items, limiter) {
204 const outputs = {}
205 const lookup = {
206 __proto__: null,
207 read: 'read-only',
208 write: 'read-write',
209 }
210 for (const item in items) {
211 const val = items[item]
212 outputs[item] = lookup[val] || val
213 }
214 if (this.npm.config.get('json')) {
215 output.buffer(outputs)
216 } else {
217 for (const item of Object.keys(outputs).sort(localeCompare)) {
218 if (!limiter || limiter === item) {
219 output.standard(`${item}: ${outputs[item]}`)
220 }
221 }
222 }
223 }
224}
225
226module.exports = Access

Callers 3

#listPackagesMethod · 0.95
#listCollaboratorsMethod · 0.95
#getStatusMethod · 0.95

Calls 4

sortMethod · 0.80
getMethod · 0.65
keysMethod · 0.65
bufferMethod · 0.45

Tested by

no test coverage detected