MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / writeTextContent

Function writeTextContent

source code/utils/file.ts:86–100  ·  view source on GitHub ↗
(
  filePath: string,
  content: string,
  encoding: BufferEncoding,
  endings: LineEndingType,
)

Source from the content-addressed store, hash-verified

84}
85
86export function writeTextContent(
87 filePath: string,
88 content: string,
89 encoding: BufferEncoding,
90 endings: LineEndingType,
91): void {
92 let toWrite = content
93 if (endings === 'CRLF') {
94 // Normalize any existing CRLF to LF first so a new_string that already
95 // contains \r\n (raw model output) doesn't become \r\r\n after the join.
96 toWrite = content.replaceAll('\r\n', '\n').split('\n').join('\r\n')
97 }
98
99 writeFileSyncAndFlush_DEPRECATED(filePath, toWrite, { encoding })
100}
101
102export function detectFileEncoding(filePath: string): BufferEncoding {
103 try {

Callers 4

callFunction · 0.85
callFunction · 0.85
callFunction · 0.85
applySedEditFunction · 0.85

Calls 1

Tested by

no test coverage detected