MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / removeIfEmpty

Function removeIfEmpty

source code/utils/plugins/cacheUtils.ts:181–189  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

179}
180
181async function removeIfEmpty(dirPath: string): Promise<void> {
182 if ((await readSubdirs(dirPath)).length === 0) {
183 try {
184 await rm(dirPath, { recursive: true, force: true })
185 } catch (error) {
186 logForDebugging(`Failed to remove empty dir: ${dirPath}: ${error}`)
187 }
188 }
189}
190
191async function readSubdirs(dirPath: string): Promise<string[]> {
192 try {

Calls 3

readSubdirsFunction · 0.85
rmFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected