Skip to content

Commit be2d60d

Browse files
VoltrexKeyvadanielleadams
authored andcommitted
lib: use validator
Used the `validateArray()` validator for array validation for consistency. (Refs: #39536) PR-URL: #39547 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 486d51a commit be2d60d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/internal/child_process.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,8 @@ ChildProcess.prototype.spawn = function(options) {
366366
// Let child process know about opened IPC channel
367367
if (options.envPairs === undefined)
368368
options.envPairs = [];
369-
else if (!ArrayIsArray(options.envPairs)) {
370-
throw new ERR_INVALID_ARG_TYPE('options.envPairs',
371-
'Array',
372-
options.envPairs);
373-
}
369+
else
370+
validateArray(options.envPairs, 'options.envPairs');
374371

375372
ArrayPrototypePush(options.envPairs, `NODE_CHANNEL_FD=${ipcFd}`);
376373
ArrayPrototypePush(options.envPairs,

0 commit comments

Comments
 (0)