(value: string)
| 196 | ]; |
| 197 | |
| 198 | export 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 | |
| 213 | export function sanitizeDiagnosticText(value: string): string { |
| 214 | return redactSecretText(sanitizePathString(value)); |
no outgoing calls
no test coverage detected