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

Function readdir

libs/platform/src/secure-fs.ts:214–225  ·  view source on GitHub ↗
(
  dirPath: string,
  options?: { withFileTypes?: boolean; encoding?: BufferEncoding }
)

Source from the content-addressed store, hash-verified

212 options: { withFileTypes: true; encoding?: BufferEncoding }
213): Promise<Dirent[]>;
214export async function readdir(
215 dirPath: string,
216 options?: { withFileTypes?: boolean; encoding?: BufferEncoding }
217): Promise<string[] | Dirent[]> {
218 const validatedPath = validatePath(dirPath);
219 return executeWithRetry<string[] | Dirent[]>(() => {
220 if (options?.withFileTypes === true) {
221 return fs.readdir(validatedPath, { withFileTypes: true });
222 }
223 return fs.readdir(validatedPath);
224 }, `readdir(${dirPath})`);
225}
226
227/**
228 * Wrapper around fs.stat that validates path first

Callers

nothing calls this directly

Calls 3

validatePathFunction · 0.85
executeWithRetryFunction · 0.85
readdirMethod · 0.80

Tested by

no test coverage detected