MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / parseHunkHeader

Function parseHunkHeader

src/codeScan/util/diffHunkParser.ts:54–66  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

52 * ```
53 */
54export 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.

Callers 2

extractValidLineRangesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…