(a: AnsiCode[], b: AnsiCode[])
| 532 | } |
| 533 | |
| 534 | function stylesEqual(a: AnsiCode[], b: AnsiCode[]): boolean { |
| 535 | if (a === b) return true // Reference equality fast path |
| 536 | const len = a.length |
| 537 | if (len !== b.length) return false |
| 538 | if (len === 0) return true // Both empty |
| 539 | for (let i = 0; i < len; i++) { |
| 540 | if (a[i]!.code !== b[i]!.code) return false |
| 541 | } |
| 542 | return true |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * Convert a string with ANSI codes into styled characters with proper grapheme |
no outgoing calls
no test coverage detected