diff options
Diffstat (limited to 'lib/child_process.js')
-rw-r--r-- | lib/child_process.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index a790e85ee2..8460a732d9 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -37,6 +37,7 @@ const { ERR_INVALID_OPT_VALUE, ERR_OUT_OF_RANGE } = require('internal/errors').codes; +const { validateString } = require('internal/validators'); const child_process = require('internal/child_process'); const { _validateStdio, @@ -390,8 +391,7 @@ function _convertCustomFds(options) { } function normalizeSpawnArguments(file, args, options) { - if (typeof file !== 'string') - throw new ERR_INVALID_ARG_TYPE('file', 'string', file); + validateString(file, 'file'); if (file.length === 0) throw new ERR_INVALID_ARG_VALUE('file', file, 'cannot be empty'); |