MCPcopy
hub / github.com/AutoMaker-Org/automaker / readFile

Function readFile

libs/platform/src/secure-fs.ts:155–166  ·  view source on GitHub ↗
(
  filePath: string,
  encoding?: BufferEncoding
)

Source from the content-addressed store, hash-verified

153 * Wrapper around fs.readFile that validates path first
154 */
155export async function readFile(
156 filePath: string,
157 encoding?: BufferEncoding
158): Promise<string | Buffer> {
159 const validatedPath = validatePath(filePath);
160 return executeWithRetry<string | Buffer>(() => {
161 if (encoding) {
162 return fs.readFile(validatedPath, encoding);
163 }
164 return fs.readFile(validatedPath);
165 }, `readFile(${filePath})`);
166}
167
168/**
169 * Options for writeFile

Callers

nothing calls this directly

Calls 3

validatePathFunction · 0.85
executeWithRetryFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected