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

Function isLineInDiff

src/codeScan/util/diffLineRanges.ts:159–166  ·  view source on GitHub ↗
(filepath: string, line: number, ranges: FileLineRanges)

Source from the content-addressed store, hash-verified

157 * @returns true if the line is within a valid range
158 */
159export function isLineInDiff(filepath: string, line: number, ranges: FileLineRanges): boolean {
160 const fileRanges = ranges.get(filepath);
161 if (!fileRanges) {
162 return false;
163 }
164
165 return fileRanges.some((range) => line >= range.start && line <= range.end);
166}
167
168/**
169 * Find the nearest valid line to a given line number.

Callers 2

clampToValidLineFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…