Skip to content

Commit e6d7b44

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

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/internal/worker.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,9 @@ class Worker extends EventEmitter {
123123
constructor(filename, options = {}) {
124124
super();
125125
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-
}
126+
if (options.execArgv)
127+
validateArray(options.execArgv, 'options.execArgv');
128+
131129
let argv;
132130
if (options.argv) {
133131
validateArray(options.argv, 'options.argv');

0 commit comments

Comments
 (0)