MCPcopy Create free account
hub / github.com/garrytan/gstack / excerptForReview

Function excerptForReview

browse/src/security.ts:628–636  ·  view source on GitHub ↗
(text: string, max = 500)

Source from the content-addressed store, hash-verified

626 * - Append "…" if truncated
627 */
628export function excerptForReview(text: string, max = 500): string {
629 if (!text) return '';
630 const cleaned = text
631 .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '')
632 .replace(/\s+/g, ' ')
633 .trim();
634 if (cleaned.length <= max) return cleaned;
635 return cleaned.slice(0, max) + '…';
636}
637
638// ─── Status reporting (for shield icon via /health) ──────────
639

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected