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

Function redactSecretText

packages/plugin/src/shared/redaction.ts:198–211  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

196];
197
198export function redactSecretText(value: string): string {
199 let redacted = value;
200 for (const { pattern, replacement } of SECRET_TEXT_PATTERNS) {
201 if (typeof replacement === "string") {
202 redacted = redacted.replace(pattern, replacement);
203 } else {
204 redacted = redacted.replace(
205 pattern,
206 replacement as (match: string, ...groups: string[]) => string,
207 );
208 }
209 }
210 return redacted;
211}
212
213export function sanitizeDiagnosticText(value: string): string {
214 return redactSecretText(sanitizePathString(value));

Callers 3

redaction.test.tsFile · 0.90
redactSecretStringFunction · 0.90
sanitizeDiagnosticTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected