MCPcopy
hub / github.com/garrytan/gstack / maskPreview

Function maskPreview

lib/redact-engine.ts:172–176  ·  view source on GitHub ↗
(span: string)

Source from the content-addressed store, hash-verified

170
171/** Show ≤4 leading chars, mask the rest. Never reconstructable. */
172export function maskPreview(span: string): string {
173 const visible = span.slice(0, 4);
174 const masked = span.length > 4 ? "*".repeat(Math.min(span.length - 4, 8)) : "";
175 return `${visible}${masked}${span.length > 12 ? "…" : ""}`;
176}
177
178// ── Tool-attributed fence detection ───────────────────────────────────────────
179

Callers 2

scanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected