MCPcopy
hub / github.com/lowlighter/metrics / info

Function info

source/app/action/index.mjs:26–37  ·  view source on GitHub ↗
(left, right, {token = false} = {})

Source from the content-addressed store, hash-verified

24
25//Info logger
26const info = (left, right, {token = false} = {}) =>
27 console.log(`${`${left}`.padEnd(63 + 9 * (/0m$/.test(left)))} │ ${
28 Array.isArray(right)
29 ? right.join(", ") || "(none)"
30 : right === undefined
31 ? "(default)"
32 : token
33 ? /^MOCKED/.test(right) ? "(MOCKED TOKEN)" : /^NOT_NEEDED$/.test(right) ? "(NOT NEEDED)" : (right ? "(provided)" : "(missing)")
34 : typeof right === "object"
35 ? JSON.stringify(right)
36 : right
37 }`)
38info.section = (left = "", right = " ") => info(`\x1b[36m${left}\x1b[0m`, right)
39info.group = ({metadata, name, inputs}) => {
40 info.section(metadata.plugins[name]?.name?.match(/(?<section>[\w\s]+)/i)?.groups?.section?.trim(), " ")

Callers 1

index.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected