Skip to content

Commit

Permalink
fix: early return when dir only contains a single dir
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed May 10, 2020
1 parent 6922202 commit a290045
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/api/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function walk(state, dir, currentDepth, callback, ...args) {
}

walkSingleDir(walk, state, dir, dirents, currentDepth, callback, ...args);
if (--state.queue <= 0) callback(null, ...args);
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/api/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function walkSingleDir(
}

groupFiles(dir, files, state);

if (--state.queue < 0) callback(null, ...args);
}

function buildFunctions(options, isSync) {
Expand Down

0 comments on commit a290045

Please sign in to comment.