MCPcopy Create free account
hub / github.com/cli/cli / redact

Function redact

evals/src/core/io.ts:72–79  ·  view source on GitHub ↗
(text: string, secrets: string[])

Source from the content-addressed store, hash-verified

70}
71
72export function redact(text: string, secrets: string[]): string {
73 for (const secret of secrets.filter(Boolean)) {
74 for (const form of [secret, encodeURIComponent(secret), Buffer.from(secret).toString("base64")]) {
75 text = text.replaceAll(form, "[REDACTED]");
76 }
77 }
78 return text;
79}
80
81export async function save(path: string, value: unknown, secrets: string[] = []): Promise<void> {
82 await mkdir(dirname(path), { recursive: true, mode: 0o700 });

Callers 6

harness.test.tsFile · 0.85
cleanup.tsFile · 0.85
logMethod · 0.85
progressMethod · 0.85
trialMethod · 0.85
saveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected