(value: string, index: number)
| 318 | } |
| 319 | |
| 320 | function readAnsiEscapeAt(value: string, index: number): string | null { |
| 321 | if (!value.startsWith(ANSI_ESCAPE_PREFIX, index)) return null; |
| 322 | for (let cursor = index + ANSI_ESCAPE_PREFIX.length; cursor < value.length; cursor += 1) { |
| 323 | if (isAnsiFinalByte(value.charCodeAt(cursor))) return value.slice(index, cursor + 1); |
| 324 | } |
| 325 | return null; |
| 326 | } |
| 327 | |
| 328 | function isAnsiFinalByte(code: number): boolean { |
| 329 | return code >= 0x40 && code <= 0x7e; |
no test coverage detected
searching dependent graphs…