MCPcopy Index your code
hub / github.com/codeaashu/claude-code / redactSecrets

Function redactSecrets

src/bridge/debugUtils.ts:26–34  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

24const REDACT_MIN_LENGTH = 16
25
26export function redactSecrets(s: string): string {
27 return s.replace(SECRET_PATTERN, (_match, field: string, value: string) => {
28 if (value.length < REDACT_MIN_LENGTH) {
29 return `"${field}":"[REDACTED]"`
30 }
31 const redacted = `${value.slice(0, 8)}...${value.slice(-4)}`
32 return `"${field}":"${redacted}"`
33 })
34}
35
36/** Truncate a string for debug logging, collapsing newlines. */
37export function debugTruncate(s: string): string {

Callers 1

debugBodyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected