MCPcopy Index your code
hub / github.com/Waishnav/devspace / patchLines

Function patchLines

src/apply-patch.ts:159–171  ·  view source on GitHub ↗
(patch: string)

Source from the content-addressed store, hash-verified

157}
158
159function patchLines(patch: string): string[] {
160 let lines = patch.replace(/\r\n/g, "\n").trim().split("\n");
161 const first = lines[0]?.trim();
162 const last = lines.at(-1)?.trim();
163 if (
164 (first === "<<EOF" || first === "<<'EOF'" || first === '<<"EOF"') &&
165 last?.endsWith("EOF") &&
166 lines.length >= 4
167 ) {
168 lines = lines.slice(1, -1);
169 }
170 return lines;
171}
172
173function isTopLevelHeader(line: string): boolean {
174 const trimmed = line.trim();

Callers 1

parsePatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected