We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
validateArray
1 parent a1bee94 commit 547fc86Copy full SHA for 547fc86
lib/internal/worker.js
@@ -1,7 +1,6 @@
1
'use strict';
2
3
const {
4
- ArrayIsArray,
5
ArrayPrototypeForEach,
6
ArrayPrototypeMap,
7
ArrayPrototypePush,
@@ -122,11 +121,9 @@ class Worker extends EventEmitter {
122
121
constructor(filename, options = {}) {
123
super();
124
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
- }
+ if (options.execArgv)
+ validateArray(options.execArgv, 'options.execArgv');
+
130
let argv;
131
if (options.argv) {
132
validateArray(options.argv, 'options.argv');
0 commit comments