Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fs: remove extraneous assignments in rmdir()
validateRmOptions() doesn't return a value, so this commit
removes the assignment. The options passed to
validateRmdirOptions() are not used again after validation, so
this commit removes the assignment.

PR-URL: #35567
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
  • Loading branch information
cjihrig committed Oct 11, 2020
commit 91e0d9bc30948dc58f8675a10a85843e0de65650
20 changes: 8 additions & 12 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,20 +859,16 @@ function rmdir(path, options, callback) {
path = pathModule.toNamespacedPath(getValidatedPath(path));

if (options && options.recursive) {
options = validateRmOptions(
path,
{ ...options, force: true },
(err, options) => {
if (err) {
return callback(err);
}

lazyLoadRimraf();
return rimraf(path, options, callback);
});
validateRmOptions(path, { ...options, force: true }, (err, options) => {
if (err) {
return callback(err);
}

lazyLoadRimraf();
return rimraf(path, options, callback);
});
} else {
options = validateRmdirOptions(options);
validateRmdirOptions(options);
const req = new FSReqCallback();
req.oncomplete = callback;
return binding.rmdir(path, req);
Expand Down