MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / truncateText

Function truncateText

cli/src/components/chat-history-screen.tsx:87–91  ·  view source on GitHub ↗
(text: string, maxLen: number)

Source from the content-addressed store, hash-verified

85
86 // Truncate text to fit single line
87 const truncateText = (text: string, maxLen: number): string => {
88 const singleLine = text.replace(/\n/g, ' ').trim()
89 if (singleLine.length <= maxLen) return singleLine
90 return singleLine.slice(0, maxLen - 1) + '…'
91 }
92
93 // Pad text to fixed width (right-pad with spaces)
94 const padRight = (text: string, width: number): string => {

Callers 1

ChatHistoryScreenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected