MCPcopy
hub / github.com/Doorman11991/smallcode / walk

Method walk

src/knowledge/loader.js:85–96  ·  view source on GitHub ↗
(sub)

Source from the content-addressed store, hash-verified

83
84 const entries = [];
85 const walk = (sub) => {
86 let listing;
87 try { listing = fs.readdirSync(sub, { withFileTypes: true }); }
88 catch { return; }
89 for (const ent of listing) {
90 const full = path.join(sub, ent.name);
91 if (ent.isDirectory()) walk(full);
92 else if (ent.isFile() && /\.(md|txt)$/i.test(ent.name)) {
93 entries.push(this._parseEntry(full, dir));
94 }
95 }
96 };
97 walk(dir);
98 this._index = entries.filter(Boolean);
99 return this._index;

Callers 1

iter_code_filesFunction · 0.80

Calls 2

_parseEntryMethod · 0.95
walkFunction · 0.85

Tested by

no test coverage detected