(data: string)
| 28 | } |
| 29 | |
| 30 | export function describeTerminalInput(data: string): string { |
| 31 | return Array.from(data) |
| 32 | .map((ch) => { |
| 33 | const code = ch.codePointAt(0) ?? 0 |
| 34 | const hex = code.toString(16).toUpperCase().padStart(4, '0') |
| 35 | const label = |
| 36 | ch === '\r' ? 'CR' |
| 37 | : ch === '\n' ? 'LF' |
| 38 | : ch === '\x1b' ? 'ESC' |
| 39 | : ch |
| 40 | return `${label}=U+${hex}` |
| 41 | }) |
| 42 | .join(' ') |
| 43 | } |
no test coverage detected