Skip to content

Commit

Permalink
fs: remove unnecessary option argument validation
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Jul 19, 2024
1 parent 6fc0218 commit 6327d7b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1310,23 +1310,23 @@ function mkdir(path, options, callback) {
if (typeof options === 'function') {
callback = options;
} else if (typeof options === 'number' || typeof options === 'string') {
mode = options;
mode = parseFileMode(options, 'mode');
} else if (options) {
if (options.recursive !== undefined)
if (options.recursive !== undefined){

Check failure on line 1315 in lib/fs.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing space before opening brace
recursive = options.recursive;
if (options.mode !== undefined)
mode = options.mode;
validateBoolean(options.recursive);
}
if (options.mode !== undefined){

Check failure on line 1319 in lib/fs.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing space before opening brace
mode = parseFileMode(options.mode, 'options.mode')

Check failure on line 1320 in lib/fs.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Missing semicolon
}
}
callback = makeCallback(callback);
path = getValidatedPath(path);

validateBoolean(recursive, 'options.recursive');

const req = new FSReqCallback();
req.oncomplete = callback;
binding.mkdir(
path,
parseFileMode(mode, 'mode'),
getValidatedPath(path),
mode,
recursive,
req,
);
Expand Down

0 comments on commit 6327d7b

Please sign in to comment.