Skip to content

Commit c459a3b

Browse files
committed
lib: use validateArray
The `validateArray()` validator could be used to cleanup validation and keep consistency.
1 parent f26c2ce commit c459a3b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/internal/worker.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const {
4-
ArrayIsArray,
54
ArrayPrototypeForEach,
65
ArrayPrototypeMap,
76
ArrayPrototypePush,
@@ -122,11 +121,9 @@ class Worker extends EventEmitter {
122121
constructor(filename, options = {}) {
123122
super();
124123
debug(`[${threadId}] create new worker`, filename, options);
125-
if (options.execArgv && !ArrayIsArray(options.execArgv)) {
126-
throw new ERR_INVALID_ARG_TYPE('options.execArgv',
127-
'Array',
128-
options.execArgv);
129-
}
124+
if (options.execArgv)
125+
validateArray(options.execArgv, 'options.execArgv');
126+
130127
let argv;
131128
if (options.argv) {
132129
validateArray(options.argv, 'options.argv');

0 commit comments

Comments
 (0)