GeezerVison is showing github.com — fs: fixup error message for invalid options.recursive · nodejs/node@8770fd9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/fs.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -859,7 +859,7 @@ function mkdir(path, options, callback) { | 859 | 859 | path = getValidatedPath(path); | 860 | 860 |
| 861 | 861 | if (typeof recursive !== 'boolean') | 862 | | - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); | | 862 | + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); | 863 | 863 |
| 864 | 864 | const req = new FSReqCallback(); | 865 | 865 | req.oncomplete = callback; | @@ -878,7 +878,7 @@ function mkdirSync(path, options) { | 878 | 878 |
| 879 | 879 | path = getValidatedPath(path); | 880 | 880 | if (typeof recursive !== 'boolean') | 881 | | - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); | | 881 | + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); | 882 | 882 |
| 883 | 883 | const ctx = { path }; | 884 | 884 | const result = binding.mkdir(pathModule.toNamespacedPath(path), | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/fs/promises.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -346,7 +346,7 @@ async function mkdir(path, options) { | 346 | 346 | } = options || {}; | 347 | 347 | path = getValidatedPath(path); | 348 | 348 | if (typeof recursive !== 'boolean') | 349 | | - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); | | 349 | + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); | 350 | 350 |
| 351 | 351 | return binding.mkdir(pathModule.toNamespacedPath(path), | 352 | 352 | parseMode(mode, 'mode', 0o777), recursive, | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-fs-mkdir.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -229,7 +229,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { | 229 | 229 | { | 230 | 230 | code: 'ERR_INVALID_ARG_TYPE', | 231 | 231 | name: 'TypeError', | 232 | | - message: 'The "recursive" argument must be of type boolean.' + | | 232 | + message: 'The "options.recursive" property must be of type boolean.' + | 233 | 233 | received | 234 | 234 | } | 235 | 235 | ); | @@ -238,7 +238,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { | 238 | 238 | { | 239 | 239 | code: 'ERR_INVALID_ARG_TYPE', | 240 | 240 | name: 'TypeError', | 241 | | - message: 'The "recursive" argument must be of type boolean.' + | | 241 | + message: 'The "options.recursive" property must be of type boolean.' + | 242 | 242 | received | 243 | 243 | } | 244 | 244 | ); | |
|