(line: string)
| 52 | * ``` |
| 53 | */ |
| 54 | export function parseHunkHeader(line: string): HunkHeader | null { |
| 55 | const match = line.match(HUNK_HEADER_REGEX); |
| 56 | if (!match) { |
| 57 | return null; |
| 58 | } |
| 59 | |
| 60 | return { |
| 61 | oldStart: parseInt(match[1], 10), |
| 62 | oldCount: match[2] ? parseInt(match[2], 10) : 1, |
| 63 | newStart: parseInt(match[3], 10), |
| 64 | newCount: match[4] ? parseInt(match[4], 10) : 1, |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Determines which type of line this is within a diff hunk. |
no outgoing calls
no test coverage detected
searching dependent graphs…