MCPcopy Index your code
hub / github.com/codeaashu/claude-code / normalizeCRLF

Function normalizeCRLF

src/utils/readEditContext.ts:160–163  ·  view source on GitHub ↗

Decode buf[0..len) to utf8, normalizing CRLF only if CR is present.

(buf: Buffer, len: number)

Source from the content-addressed store, hash-verified

158
159/** Decode buf[0..len) to utf8, normalizing CRLF only if CR is present. */
160function normalizeCRLF(buf: Buffer, len: number): string {
161 const s = buf.toString('utf8', 0, len)
162 return s.includes('\r') ? s.replaceAll('\r\n', '\n') : s
163}
164
165/**
166 * Given an absolute match offset, read ±contextLines around it and return

Callers 2

readCappedFunction · 0.85
sliceContextFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected