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

Method wrap

deps/npm/lib/commands/completion.js:162–170  ·  view source on GitHub ↗
(opts, compls)

Source from the content-addressed store, hash-verified

160 // If any of the items are arrays, then join them with a space.
161 // e.g. returning ['a', 'b c', ['d', 'e']] would allow it to expand to: 'a', 'b c', or 'd' 'e'
162 wrap (opts, compls) {
163 if (opts.partialWord) {
164 compls = compls.filter(c => c.startsWith(opts.partialWord))
165 }
166
167 if (compls.length > 0) {
168 output.standard(compls.join('\n'))
169 }
170 }
171}
172
173const dumpScript = async (p) => {

Callers 1

execMethod · 0.95

Calls 2

filterMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected