MCPcopy
hub / github.com/codeaashu/claude-code / debugTruncate

Function debugTruncate

src/bridge/debugUtils.ts:37–43  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

35
36/** Truncate a string for debug logging, collapsing newlines. */
37export function debugTruncate(s: string): string {
38 const flat = s.replace(/\n/g, '\\n')
39 if (flat.length <= DEBUG_MSG_LIMIT) {
40 return flat
41 }
42 return flat.slice(0, DEBUG_MSG_LIMIT) + `... (${flat.length} chars)`
43}
44
45/** Truncate a JSON-serializable value for debug logging. */
46export function debugBody(data: unknown): string {

Callers 2

spawnFunction · 0.85
writeStdinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected