Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lib: use validateArray
The `validateArray()` validator could be used to cleanup validation
and keep consistency.
  • Loading branch information
VoltrexKeyva committed Sep 3, 2021
commit c459a3bdfbf218167ddac94fa0404fa6962c13b4
9 changes: 3 additions & 6 deletions lib/internal/worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const {
ArrayIsArray,
ArrayPrototypeForEach,
ArrayPrototypeMap,
ArrayPrototypePush,
Expand Down Expand Up @@ -122,11 +121,9 @@ class Worker extends EventEmitter {
constructor(filename, options = {}) {
super();
debug(`[${threadId}] create new worker`, filename, options);
if (options.execArgv && !ArrayIsArray(options.execArgv)) {
throw new ERR_INVALID_ARG_TYPE('options.execArgv',
'Array',
options.execArgv);
}
if (options.execArgv)
validateArray(options.execArgv, 'options.execArgv');

let argv;
if (options.argv) {
validateArray(options.argv, 'options.argv');
Expand Down