MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / normalizeDiffLines

Function normalizeDiffLines

sdk/src/tools/apply-patch.ts:93–98  ·  view source on GitHub ↗
(diff: string)

Source from the content-addressed store, hash-verified

91}
92
93function normalizeDiffLines(diff: string): string[] {
94 return diff
95 .split(/\r?\n/)
96 .map((line) => line.replace(/\r$/, ''))
97 .filter((line, idx, arr) => !(idx === arr.length - 1 && line === ''))
98}
99
100function isDone(state: ParserState, prefixes: string[]): boolean {
101 if (state.index >= state.lines.length) {

Callers 1

applyDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected