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

Function preserveOriginalLineEndings

sdk/src/tools/apply-patch.ts:469–480  ·  view source on GitHub ↗
(params: {
  original: string
  patched: string
})

Source from the content-addressed store, hash-verified

467}
468
469function preserveOriginalLineEndings(params: {
470 original: string
471 patched: string
472}): string {
473 const { original, patched } = params
474
475 if (!isConsistentlyCrlf(original)) {
476 return patched
477 }
478
479 return normalizeLineEndings(patched).replace(/\n/g, '\r\n')
480}
481
482function buildPatchAttempts(oldContent: string, diff: string): PatchAttempt[] {
483 const normalizedOld = normalizeLineEndings(oldContent)

Callers 1

applyPatchToolFunction · 0.85

Calls 2

isConsistentlyCrlfFunction · 0.85
normalizeLineEndingsFunction · 0.70

Tested by

no test coverage detected