Spaces:
Running on Zero
Running on Zero
Download backend/llama.cpp/tools/ui/src/lib/utils/redact.ts from kazutab/mindmap-studio: direct link, hf CLI and curl.
- Browser
- Download file 416 Bytes
-
https://huggingface.co/spaces/kazutab/mindmap-studio/resolve/main/backend/llama.cpp/tools/ui/src/lib/utils/redact.ts
- Command line
-
hf download hf://spaces/kazutab/mindmap-studio/backend/llama.cpp/tools/ui/src/lib/utils/redact.ts
-
curl -L -o redact.ts https://huggingface.co/spaces/kazutab/mindmap-studio/resolve/main/backend/llama.cpp/tools/ui/src/lib/utils/redact.ts
416 Bytes
| /** | |
| * 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]'; | |
| } | |