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

Function normalizeLineEndings

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

Source from the content-addressed store, hash-verified

20import * as Bom from "@/util/bom"
21
22function normalizeLineEndings(text: string): string {
23 return text.replaceAll("\r\n", "\n")
24}
25
26function detectLineEnding(text: string): "\n" | "\r\n" {
27 return text.includes("\r\n") ? "\r\n" : "\n"

Callers 1

edit.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected