227ed28e12
* Add MCP Connection diagnostics and CORS hint to web-ui * tidy up test * webui: Refactor and improve MCP diagnostic logging --------- Co-authored-by: evalstate <1936278+evalstate@users.noreply.github.com>
15 lines
416 B
TypeScript
15 lines
416 B
TypeScript
/**
|
|
* Redacts a sensitive value, optionally showing the last N characters.
|
|
*
|
|
* @param value - The value to redact
|
|
* @param showLastChars - If provided, reveals the last N characters with a leading mask
|
|
* @returns The redacted string
|
|
*/
|
|
export function redactValue(value: string, showLastChars?: number): string {
|
|
if (showLastChars) {
|
|
return `....${value.slice(-showLastChars)}`;
|
|
}
|
|
|
|
return '[redacted]';
|
|
}
|