(data: FileListData)
| 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); |
no test coverage detected