MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / summariseDir

Function summariseDir

src/context/tree.ts:196–204  ·  view source on GitHub ↗

Cheap one-line summary of a directory: `(N items)`. Best-effort; failure → empty.

(dir: string)

Source from the content-addressed store, hash-verified

194
195/** Cheap one-line summary of a directory: `(N items)`. Best-effort; failure → empty. */
196async function summariseDir(dir: string): Promise<string> {
197 try {
198 const items = await fs.readdir(dir);
199 const visible = items.filter(n => !IGNORED_DIRS.has(n) && !IGNORED_FILES.has(n) && !n.startsWith('.'));
200 return `(${visible.length} item${visible.length === 1 ? '' : 's'})`;
201 } catch {
202 return '';
203 }
204}
205
206function pushLine(line: string, ctx: TreeContext): void {
207 ctx.lines.push(line);

Callers 1

walkFunction · 0.85

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected