(headerLine: string)
| 12 | } |
| 13 | |
| 14 | export const parseHunkHeaderLine = (headerLine: string): HunkHeader => { |
| 15 | const match = headerLine |
| 16 | .trim() |
| 17 | .match(/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/) |
| 18 | if (!match) { |
| 19 | throw new Error(`Bad header line: '${headerLine}'`) |
| 20 | } |
| 21 | |
| 22 | return { |
| 23 | original: { |
| 24 | start: Math.max(Number(match[1]), 1), |
| 25 | length: Number(match[3] || 1), |
| 26 | }, |
| 27 | patched: { |
| 28 | start: Math.max(Number(match[4]), 1), |
| 29 | length: Number(match[6] || 1), |
| 30 | }, |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | export const NON_EXECUTABLE_FILE_MODE = 0o644 |
| 35 | export const EXECUTABLE_FILE_MODE = 0o755 |
no outgoing calls
no test coverage detected
searching dependent graphs…