GeezerVison is showing github.com — fs: fixup error message for invalid options.recursive · nodejs/node@b85bc0c
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 |
|---|
@@ -813,7 +813,7 @@ function mkdir(path, options, callback) { | 813 | 813 | path = getValidatedPath(path); | 814 | 814 |
| 815 | 815 | if (typeof recursive !== 'boolean') | 816 | | - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); | | 816 | + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); | 817 | 817 |
| 818 | 818 | const req = new FSReqCallback(); | 819 | 819 | req.oncomplete = callback; | @@ -832,7 +832,7 @@ function mkdirSync(path, options) { | 832 | 832 |
| 833 | 833 | path = getValidatedPath(path); | 834 | 834 | if (typeof recursive !== 'boolean') | 835 | | - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); | | 835 | + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); | 836 | 836 |
| 837 | 837 | const ctx = { path }; | 838 | 838 | 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 |
|---|
@@ -333,7 +333,7 @@ async function mkdir(path, options) { | 333 | 333 | } = options || {}; | 334 | 334 | path = getValidatedPath(path); | 335 | 335 | if (typeof recursive !== 'boolean') | 336 | | - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); | | 336 | + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); | 337 | 337 |
| 338 | 338 | return binding.mkdir(pathModule.toNamespacedPath(path), | 339 | 339 | 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 | ); | |
|