(originalContent: string, newContent: string, filepath: string = 'file')
| 58 | } |
| 59 | |
| 60 | export function createUnifiedDiff(originalContent: string, newContent: string, filepath: string = 'file'): string { |
| 61 | // Ensure consistent line endings for diff |
| 62 | const normalizedOriginal = normalizeLineEndings(originalContent); |
| 63 | const normalizedNew = normalizeLineEndings(newContent); |
| 64 | |
| 65 | return createTwoFilesPatch( |
| 66 | filepath, |
| 67 | filepath, |
| 68 | normalizedOriginal, |
| 69 | normalizedNew, |
| 70 | 'original', |
| 71 | 'modified' |
| 72 | ); |
| 73 | } |
| 74 | |
| 75 | // Helper function to resolve relative paths against allowed directories |
| 76 | function resolveRelativePathAgainstAllowedDirectories(relativePath: string): string { |
no test coverage detected