MCPcopy Index your code
hub / github.com/nodejs/node / logObject

Function logObject

deps/npm/lib/utils/key-values.js:10–26  ·  view source on GitHub ↗
(values, { chalk, json, predicate = defaultPredicate })

Source from the content-addressed store, hash-verified

8}
9
10function logObject (values, { chalk, json, predicate = defaultPredicate }) {
11 if (json) {
12 output.standard(JSON.stringify(values, null, 2), { [META]: true, redact: false })
13 return
14 }
15
16 const lines = []
17 for (const [key, value] of Object.entries(values)) {
18 const formatted = predicate(key, value, chalk)
19 if (formatted !== null) {
20 lines.push(`${chalk.cyan(key)}: ${formatted}`)
21 }
22 }
23 if (lines.length) {
24 output.standard(lines.join('\n'), { [META]: true, redact: false })
25 }
26}
27
28function logStageItem (item, { chalk }) {
29 const { id, packageName, version, tag, createdAt, actor, actorType, shasum, ...rest } = item

Callers 2

logStageItemFunction · 0.85
key-values.jsFile · 0.85

Calls 4

predicateFunction · 0.50
entriesMethod · 0.45
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…