(directoryPath: string)
| 92 | } |
| 93 | |
| 94 | export function getAllFilePaths(directoryPath: string): string[] { |
| 95 | directoryPath = resolveFilePath(directoryPath); |
| 96 | |
| 97 | const files: string[] = []; |
| 98 | function traverseDirectories(dir: string) { |
| 99 | fs.readdirSync(dir, { withFileTypes: true }).forEach(file => { |
| 100 | const fullPath = path.join(dir, file.name); |
| 101 | if (file.isDirectory()) { |
| 102 | traverseDirectories(fullPath); |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | files.push(fullPath); |
| 107 | }); |
| 108 | } |
| 109 | |
| 110 | traverseDirectories(directoryPath); |
| 111 | |
| 112 | return files; |
| 113 | } |
| 114 | |
| 115 | export function isDirectoryEmpty(directoryPath: string): boolean { |
| 116 | const absPath = resolveFilePath(directoryPath); |
no test coverage detected