| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 297773c commit 0defe4e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,6 @@ | |||
| 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(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments