MCPcopy Create free account
hub / github.com/Snapchat/Valdi / isDirectoryEmpty

Function isDirectoryEmpty

npm_modules/cli/src/utils/fileUtils.ts:115–121  ·  view source on GitHub ↗
(directoryPath: string)

Source from the content-addressed store, hash-verified

113}
114
115export function isDirectoryEmpty(directoryPath: string): boolean {
116 const absPath = resolveFilePath(directoryPath);
117 const dir = fs.opendirSync(absPath);
118 const firstEntry = dir.readSync();
119 dir.closeSync();
120 return firstEntry === null;
121}
122
123export function getFilesSortedByUpdatedTime(directoryPath: string): string[] {
124 directoryPath = resolveFilePath(directoryPath);

Callers 1

valdiBootstrapFunction · 0.90

Calls 1

resolveFilePathFunction · 0.85

Tested by

no test coverage detected