(value: string)
| 8 | * Control characters: 0x00-0x1f and 0x7f (DEL). |
| 9 | */ |
| 10 | export function findControlCharacter(value: string): { position: number; hex: string } | null { |
| 11 | for (let i = 0; i < value.length; i++) { |
| 12 | const code = value.charCodeAt(i); |
| 13 | if ((code >= 0x00 && code <= 0x1f) || code === 0x7f) { |
| 14 | return { position: i, hex: `0x${code.toString(16).padStart(2, "0")}` }; |
| 15 | } |
| 16 | } |
| 17 | return null; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Check whether a string contains any control characters. |
no outgoing calls
no test coverage detected
searching dependent graphs…