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

Function detectLineEnding

packages/opencode/src/tool/edit.ts:26–28  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

24}
25
26function detectLineEnding(text: string): "\n" | "\r\n" {
27 return text.includes("\r\n") ? "\r\n" : "\n"
28}
29
30function convertToLineEnding(text: string, ending: "\n" | "\r\n"): string {
31 if (ending === "\n") return text

Callers 1

edit.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected