MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / entryFor

Function entryFor

projects/runtime-node/src/localFiles.ts:43–58  ·  view source on GitHub ↗
(dir: string, name: string)

Source from the content-addressed store, hash-verified

41}
42
43async function entryFor(dir: string, name: string): Promise<PathEntry | null> {
44 const fullPath = path.join(dir, name)
45 try {
46 const stat = await fs.lstat(fullPath)
47 return {
48 name,
49 path: fullPath,
50 isDir: stat.isDirectory(),
51 isSymlink: stat.isSymbolicLink(),
52 size: stat.size,
53 mode: stat.mode,
54 }
55 } catch {
56 return null
57 }
58}
59
60async function readFileSample(filePath: string, size: number): Promise<Uint8Array> {
61 if (size <= 0) return new Uint8Array()

Callers 1

describePathFunction · 0.85

Calls 1

isDirectoryMethod · 0.80

Tested by

no test coverage detected