* Check if two arrays of lines match after trimming trailing whitespace.
(lines: string[], pattern: string[], startIndex: number)
| 51 | * Check if two arrays of lines match after trimming trailing whitespace. |
| 52 | */ |
| 53 | function trimEndMatch(lines: string[], pattern: string[], startIndex: number): boolean { |
| 54 | for (let i = 0; i < pattern.length; i++) { |
| 55 | if (lines[startIndex + i]?.trimEnd() !== pattern[i]?.trimEnd()) { |
| 56 | return false |
| 57 | } |
| 58 | } |
| 59 | return true |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Check if two arrays of lines match after trimming both sides. |