MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / lsDir

Function lsDir

src/fileSystem/internalFs.js:390–406  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

388function createFs(url) {
389 return {
390 async lsDir() {
391 const files = [];
392 const entries = await internalFs.listDir(url);
393
394 entries.map((entry) => {
395 const url = decodeURIComponent(entry.nativeURL);
396 const name = Url.basename(url);
397 files.push({
398 name,
399 url,
400 isDirectory: entry.isDirectory,
401 isFile: entry.isFile,
402 });
403 });
404
405 return files;
406 },
407 async readFile(encoding) {
408 let { data } = await internalFs.readFile(url, encoding);
409

Callers

nothing calls this directly

Calls 2

basenameMethod · 0.80
listDirMethod · 0.65

Tested by

no test coverage detected