Skip to content

Commit 60e51ad

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

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,
@@ -123,11 +122,9 @@ class Worker extends EventEmitter {
123122
constructor(filename, options = {}) {
124123
super();
125124
debug(`[${threadId}] create new worker`, filename, options);
126-
if (options.execArgv && !ArrayIsArray(options.execArgv)) {
127-
throw new ERR_INVALID_ARG_TYPE('options.execArgv',
128-
'Array',
129-
options.execArgv);
130-
}
125+
if (options.execArgv)
126+
validateArray(options.execArgv, 'options.execArgv');
127+
131128
let argv;
132129
if (options.argv) {
133130
validateArray(options.argv, 'options.argv');

0 commit comments

Comments
 (0)