MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isDirEmpty

Function isDirEmpty

src/utils/file.ts:335–343  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

333 * @returns true if the directory is empty or does not exist, false otherwise
334 */
335export 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.

Callers 1

getStepsFunction · 0.85

Calls 2

getFsImplementationFunction · 0.85
isENOENTFunction · 0.85

Tested by

no test coverage detected