Spaces:
Running
Running
| import { clsx, type ClassValue } from "clsx"; | |
| import { twMerge } from "tailwind-merge"; | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)); | |
| } | |
| /** | |
| * HARNESS: PII Sanitization Utility. | |
| * Masks sensitive patterns to prevent accidental data leakage in telemetry. | |
| */ | |
| export function sanitizeContent(content: string): string { | |
| if (!content) return content; | |
| return content | |
| .replace(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g, "[EMAIL_MASKED]") | |
| .replace(/(sk-|AIza|AKIA)[a-zA-Z0-9]{20,}/g, "[SECRET_MASKED]") | |
| .replace(/\b\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/g, "[CARD_MASKED]"); | |
| } | |