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

Function readFileSafe

source code/utils/file.ts:52–60  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

50export const MAX_OUTPUT_SIZE = 0.25 * 1024 * 1024 // 0.25MB in bytes
51
52export function readFileSafe(filepath: string): string | null {
53 try {
54 const fs = getFsImplementation()
55 return fs.readFileSync(filepath, { encoding: 'utf8' })
56 } catch (error) {
57 logError(error)
58 return null
59 }
60}
61
62/**
63 * Get the normalized modification time of a file in milliseconds.

Callers 1

DiffDetailViewFunction · 0.85

Calls 2

getFsImplementationFunction · 0.85
logErrorFunction · 0.70

Tested by

no test coverage detected