File tree 1 file changed +2
-7
lines changed
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
const {
4
- ArrayIsArray,
5
4
ArrayPrototypeJoin,
6
5
SafeSet,
7
6
Symbol,
@@ -17,7 +16,6 @@ const kMaxTracingCount = 10;
17
16
const {
18
17
ERR_TRACE_EVENTS_CATEGORY_REQUIRED ,
19
18
ERR_TRACE_EVENTS_UNAVAILABLE ,
20
- ERR_INVALID_ARG_TYPE
21
19
} = require ( 'internal/errors' ) . codes ;
22
20
23
21
const { ownsProcessState } = require ( 'internal/worker' ) ;
@@ -29,6 +27,7 @@ const { customInspectSymbol } = require('internal/util');
29
27
const { format } = require ( 'internal/util/inspect' ) ;
30
28
const {
31
29
validateObject,
30
+ validateStringArray,
32
31
} = require ( 'internal/validators' ) ;
33
32
34
33
const enabledTracingObjects = new SafeSet ( ) ;
@@ -84,11 +83,7 @@ class Tracing {
84
83
85
84
function createTracing ( options ) {
86
85
validateObject ( options , 'options' ) ;
87
-
88
- if ( ! ArrayIsArray ( options . categories ) ) {
89
- throw new ERR_INVALID_ARG_TYPE ( 'options.categories' , 'string[]' ,
90
- options . categories ) ;
91
- }
86
+ validateStringArray ( options . categories , 'options.categories' ) ;
92
87
93
88
if ( options . categories . length <= 0 )
94
89
throw new ERR_TRACE_EVENTS_CATEGORY_REQUIRED ( ) ;
You can’t perform that action at this time.
0 commit comments