1/**
2 * Strips invisible control characters (zero-width, RTL/LTR overrides,
3 * bidi isolates, BOM) and trims whitespace.
4 */
5export function stripControlCharacters(text: string): string {
6 return text.replace(/[\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g, '').trim()
7}