MCPcopy Index your code
hub / github.com/anomalyco/opencode / normalize

Function normalize

packages/opencode/test/tool/edit.test.ts:344–348  ·  view source on GitHub ↗
(text: string, ending: "\n" | "\r\n")

Source from the content-addressed store, hash-verified

342 const alt = "alpha\nbeta\nomega"
343
344 const normalize = (text: string, ending: "\n" | "\r\n") => {
345 const normalized = text.replaceAll("\r\n", "\n")
346 if (ending === "\n") return normalized
347 return normalized.replaceAll("\n", "\r\n")
348 }
349
350 const count = (content: string) => {
351 const crlf = content.match(/\r\n/g)?.length ?? 0

Callers 1

edit.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected