MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / truncate

Function truncate

packages/mcp-server/src/format.ts:101–103  ·  view source on GitHub ↗
(text: string, maxLen: number)

Source from the content-addressed store, hash-verified

99}
100
101function truncate(text: string, maxLen: number): string {
102 return text.length <= maxLen ? text : text.slice(0, maxLen) + '...'
103}
104
105function formatTimestamp(ts: number): string {
106 const d = new Date(ts * 1000)

Callers 1

flushFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected