(lines: string[], pattern: string[], startIndex: number)
| 408 | } |
| 409 | |
| 410 | function seekSequence(lines: string[], pattern: string[], startIndex: number): number { |
| 411 | if (pattern.length === 0) return -1 |
| 412 | |
| 413 | // Simple substring search implementation |
| 414 | for (let i = startIndex; i <= lines.length - pattern.length; i++) { |
| 415 | let matches = true |
| 416 | |
| 417 | for (let j = 0; j < pattern.length; j++) { |
| 418 | if (lines[i + j] !== pattern[j]) { |
| 419 | matches = false |
| 420 | break |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | if (matches) { |
| 425 | return i |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | return -1 |
| 430 | } |
| 431 | |
| 432 | function generateUnifiedDiff(oldContent: string, newContent: string): string { |
| 433 | const oldLines = oldContent.split("\n") |
no outgoing calls
no test coverage detected