MCPcopy Index your code
hub / github.com/rtfpessoa/diff2html / existHunkHeader

Function existHunkHeader

src/diff-parser.ts:238–258  ·  view source on GitHub ↗
(line: string, lineIdx: number)

Source from the content-addressed store, hash-verified

236 * Hunk header is a group of three lines started by ( `--- ` , `+++ ` , `@@` )
237 */
238 function existHunkHeader(line: string, lineIdx: number): boolean {
239 let idx = lineIdx;
240
241 while (idx < diffLines.length - 3) {
242 if (line.startsWith('diff')) {
243 return false;
244 }
245
246 if (
247 diffLines[idx].startsWith(oldFileNameHeader) &&
248 diffLines[idx + 1].startsWith(newFileNameHeader) &&
249 diffLines[idx + 2].startsWith(hunkHeaderPrefix)
250 ) {
251 return true;
252 }
253
254 idx++;
255 }
256
257 return false;
258 }
259
260 diffLines.forEach((line, lineIndex) => {
261 // Unmerged paths, and possibly other non-diffable files

Callers 1

parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…