GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: remove unnecessary option argument validation · nodejs/node@8086337

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • fs.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,19 +1349,20 @@ function mkdirSync(path, options) {
13491349
let mode = 0o777;
13501350
let recursive = false;
13511351
if (typeof options === 'number' || typeof options === 'string') {
1352-
mode = options;
1352+
mode = parseFileMode(options, 'mode');
13531353
} else if (options) {
1354-
if (options.recursive !== undefined)
1354+
if (options.recursive !== undefined) {
13551355
recursive = options.recursive;
1356-
if (options.mode !== undefined)
1357-
mode = options.mode;
1356+
validateBoolean(recursive, 'options.recursive');
1357+
}
1358+
if (options.mode !== undefined) {
1359+
mode = parseFileMode(options.mode, 'options.mode');
1360+
}
13581361
}
1359-
path = getValidatedPath(path);
1360-
validateBoolean(recursive, 'options.recursive');
13611362

13621363
const result = binding.mkdir(
1363-
path,
1364-
parseFileMode(mode, 'mode'),
1364+
getValidatedPath(path),
1365+
mode,
13651366
recursive,
13661367
);
13671368

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.