* Check if two arrays of lines match exactly.
(lines: string[], pattern: string[], startIndex: number)
| 39 | * Check if two arrays of lines match exactly. |
| 40 | */ |
| 41 | function exactMatch(lines: string[], pattern: string[], startIndex: number): boolean { |
| 42 | for (let i = 0; i < pattern.length; i++) { |
| 43 | if (lines[startIndex + i] !== pattern[i]) { |
| 44 | return false |
| 45 | } |
| 46 | } |
| 47 | return true |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Check if two arrays of lines match after trimming trailing whitespace. |