MCPcopy
hub / github.com/wavetermdev/waveterm / fileList

Function fileList

frontend/preview/mock/mockfilesystem.ts:474–482  ·  view source on GitHub ↗
(data: FileListData)

Source from the content-addressed store, hash-verified

472 };
473 };
474 const fileList = async (data: FileListData): Promise<FileInfo[]> => {
475 const dirPath = normalizeMockPath(data?.path ?? MockHomePath);
476 const entry = getEntry(dirPath);
477 if (entry == null || !entry.isdir) {
478 return [];
479 }
480 const dirEntries = (childrenByDir.get(dirPath) ?? []).map((child) => toFileInfo(child));
481 return sliceEntries(dirEntries, data?.opts);
482 };
483 const fileJoin = async (paths: string[]): Promise<FileInfo> => {
484 const path = paths.length === 1 ? normalizeMockPath(paths[0]) : joinPaths(paths);
485 const entry = getEntry(path);

Callers 1

makeMockFilesystemFunction · 0.85

Calls 5

normalizeMockPathFunction · 0.85
getEntryFunction · 0.85
toFileInfoFunction · 0.85
sliceEntriesFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected