MCPcopy Create free account
hub / github.com/code-pushup/cli / truncateBody

Function truncateBody

packages/ci/src/lib/comment.ts:42–49  ·  view source on GitHub ↗
(body: string, max: number)

Source from the content-addressed store, hash-verified

40}
41
42function truncateBody(body: string, max: number): string {
43 const truncateWarning = '...*[Comment body truncated]*';
44 if (body.length > max) {
45 logWarning(`Comment body is too long. Truncating to ${max} characters.`);
46 return body.slice(0, max - truncateWarning.length) + truncateWarning;
47 }
48 return body;
49}

Callers 1

commentOnPRFunction · 0.85

Calls 1

logWarningFunction · 0.85

Tested by

no test coverage detected