diff --git a/lib/fs.js b/lib/fs.js index 7a3480a0eca9a8..81bfaee1fd59a6 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -863,7 +863,7 @@ function mkdir(path, options, callback) { path = getValidatedPath(path); if (typeof recursive !== 'boolean') - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); const req = new FSReqCallback(); req.oncomplete = callback; @@ -884,7 +884,7 @@ function mkdirSync(path, options) { } path = getValidatedPath(path); if (typeof recursive !== 'boolean') - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); const ctx = { path }; const result = binding.mkdir(pathModule.toNamespacedPath(path), diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 12cca60ae30de2..e75a7bc19111c4 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -345,7 +345,7 @@ async function mkdir(path, options) { } = options || {}; path = getValidatedPath(path); if (typeof recursive !== 'boolean') - throw new ERR_INVALID_ARG_TYPE('recursive', 'boolean', recursive); + throw new ERR_INVALID_ARG_TYPE('options.recursive', 'boolean', recursive); return binding.mkdir(pathModule.toNamespacedPath(path), parseFileMode(mode, 'mode', 0o777), recursive, diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index add0926f8379f6..5e28d6b944b6e0 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -229,7 +229,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "recursive" argument must be of type boolean.' + + message: 'The "options.recursive" property must be of type boolean.' + received } ); @@ -238,7 +238,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "recursive" argument must be of type boolean.' + + message: 'The "options.recursive" property must be of type boolean.' + received } );