MCPcopy
hub / github.com/google/zx / echo

Function echo

src/goods.ts:151–157  ·  view source on GitHub ↗
(pieces: TemplateStringsArray, ...args: any[])

Source from the content-addressed store, hash-verified

149
150export function echo(...args: any[]): void
151export function echo(pieces: TemplateStringsArray, ...args: any[]) {
152 const msg = isStringLiteral(pieces, ...args)
153 ? args.map((a, i) => pieces[i] + stringify(a)).join('') + getLast(pieces)
154 : [pieces, ...args].map(stringify).join(' ')
155
156 console.log(msg)
157}
158
159function stringify(arg: any) {
160 return arg instanceof ProcessOutput ? arg.toString().trimEnd() : `${arg}`

Callers 4

goods.test.tsFile · 0.90
goods.test-d.tsFile · 0.85
mainFunction · 0.85
fetch-weather.mjsFile · 0.85

Calls 2

getLastFunction · 0.90
stringifyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…