MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / truncateToLines

Function truncateToLines

source code/utils/stringUtils.ts:231–237  ·  view source on GitHub ↗
(text: string, maxLines: number)

Source from the content-addressed store, hash-verified

229 * @returns The truncated text with ellipsis if truncated
230 */
231export function truncateToLines(text: string, maxLines: number): string {
232 const lines = text.split('\n')
233 if (lines.length <= maxLines) {
234 return text
235 }
236 return lines.slice(0, maxLines).join('\n') + '…'
237}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected