Sanitizes a string by redacting URL credentials.
(value: string | null | undefined)
| 251 | |
| 252 | /** Sanitizes a string by redacting URL credentials. */ |
| 253 | function sanitize(value: string | null | undefined): string { |
| 254 | if (!value) { |
| 255 | return ''; |
| 256 | } |
| 257 | return value.replace(/(https?:\/\/)([^@:/]*)(:[^@/]+)?@/g, '$1<TOKEN>@'); |
| 258 | } |
no outgoing calls
no test coverage detected