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

Function splitFile

src/apply-patch.ts:219–226  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

217}
218
219function splitFile(content: string): { lines: string[]; eol: string; finalNewline: boolean } {
220 const eol = content.includes("\r\n") ? "\r\n" : "\n";
221 const normalized = content.replace(/\r\n/g, "\n");
222 const finalNewline = normalized.endsWith("\n");
223 const lines = normalized.split("\n");
224 if (finalNewline) lines.pop();
225 return { lines, eol, finalNewline };
226}
227
228function findSequence(haystack: string[], needle: string[], from: number, endOfFile = false): number {
229 if (needle.length === 0) return from;

Callers 1

applyHunksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected