(dirPath: string)
| 333 | * @returns true if the directory is empty or does not exist, false otherwise |
| 334 | */ |
| 335 | export function isDirEmpty(dirPath: string): boolean { |
| 336 | try { |
| 337 | return getFsImplementation().isDirEmptySync(dirPath) |
| 338 | } catch (e) { |
| 339 | // ENOENT: directory doesn't exist, consider it empty |
| 340 | // Other errors (EPERM on macOS protected folders, etc.): assume not empty |
| 341 | return isENOENT(e) |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Reads a file with caching to avoid redundant I/O operations. |
no test coverage detected