MCPcopy Create free account
hub / github.com/cloudflare/computer / normalizeToLF

Function normalizeToLF

packages/computer/src/tools/fs/edit-diff.ts:20–22  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

18}
19
20export function normalizeToLF(text: string): string {
21 return text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
22}
23
24export function restoreLineEndings(text: string, ending: "\r\n" | "\n"): string {
25 return ending === "\r\n" ? text.replace(/\n/g, "\r\n") : text;

Callers 2

createEditToolFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected