MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / truncateToLines

Function truncateToLines

src/utils/stringUtils.ts:229–235  ·  view source on GitHub ↗
(text: string, maxLines: number)

Source from the content-addressed store, hash-verified

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

Callers 3

MonitorPermissionRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected