MCPcopy Create free account
hub / github.com/codeaashu/claude-code / truncate

Function truncate

web/lib/utils.ts:28–31  ·  view source on GitHub ↗
(str: string, maxLength: number)

Source from the content-addressed store, hash-verified

26}
27
28export function truncate(str: string, maxLength: number): string {
29 if (str.length <= maxLength) return str;
30 return str.slice(0, maxLength - 3) + "...";
31}
32
33export function extractTextContent(content: unknown): string {
34 if (typeof content === "string") return content;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected