(input: Buffer | string)
| 194 | } |
| 195 | |
| 196 | function inputToString(input: Buffer | string): string { |
| 197 | if (Buffer.isBuffer(input)) { |
| 198 | if (input[0]! > 127 && input[1] === undefined) { |
| 199 | ;(input[0] as unknown as number) -= 128 |
| 200 | return '\x1b' + String(input) |
| 201 | } else { |
| 202 | return String(input) |
| 203 | } |
| 204 | } else if (input !== undefined && typeof input !== 'string') { |
| 205 | return String(input) |
| 206 | } else if (!input) { |
| 207 | return '' |
| 208 | } else { |
| 209 | return input |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | export function parseMultipleKeypresses( |
| 214 | prevState: KeyParseState, |
no outgoing calls
no test coverage detected