MCPcopy Create free account
hub / github.com/cortexkit/magic-context / formatPreview

Function formatPreview

packages/plugin/scripts/embedding-baseline-diff.ts:85–88  ·  view source on GitHub ↗
(text: string, max = 90)

Source from the content-addressed store, hash-verified

83}
84
85function formatPreview(text: string, max = 90): string {
86 const cleaned = text.replace(/\s+/g, " ").trim();
87 return cleaned.length > max ? `${cleaned.slice(0, max - 1)}…` : cleaned;
88}
89
90function mean(values: number[]): number {
91 if (values.length === 0) return 0;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected