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

Function restoreLineEndings

packages/computer/src/tools/fs/edit-diff.ts:24–26  ·  view source on GitHub ↗
(text: string, ending: "\r\n" | "\n")

Source from the content-addressed store, hash-verified

22}
23
24export function restoreLineEndings(text: string, ending: "\r\n" | "\n"): string {
25 return ending === "\r\n" ? text.replace(/\n/g, "\r\n") : text;
26}
27
28export function stripBom(content: string): { bom: string; text: string } {
29 return content.startsWith("\uFEFF")

Callers 1

createEditToolFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected