MCPcopy
hub / github.com/infinitered/reactotron / truncateValue

Function truncateValue

lib/reactotron-mcp/src/serialization.ts:144–148  ·  view source on GitHub ↗

Truncate any value to a compact JSON preview.

(value: unknown, limit: number)

Source from the content-addressed store, hash-verified

142
143/** Truncate any value to a compact JSON preview. */
144function truncateValue(value: unknown, limit: number): string {
145 const text = typeof value === "string" ? value : compactJson(value)
146 if (text.length <= limit) return text
147 return text.slice(0, limit) + "..."
148}

Callers 1

summarizeNetworkEntryFunction · 0.85

Calls 1

compactJsonFunction · 0.85

Tested by

no test coverage detected