File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,13 @@ const getRequiredOption = (options, optionName) => {
18
18
} ;
19
19
20
20
const getApiKey = ( { apiKey, token } ) => {
21
- let calculatedApiKey = apiKey ;
22
- if ( ! calculatedApiKey ) {
23
- calculatedApiKey = token ;
24
- if ( ! calculatedApiKey ) {
25
- throw new ReportPortalRequiredOptionError ( 'apiKey' ) ;
26
- } else {
27
- console . warn ( `Option 'token' is deprecated. Use 'apiKey' instead.` ) ;
28
- }
29
- }
30
-
31
- return calculatedApiKey ;
32
- } ;
21
+ if ( apiKey ) return apiKey ;
22
+
23
+ if ( ! token ) throw new ReportPortalRequiredOptionError ( 'apiKey' ) ;
24
+
25
+ console . warn ( `Option 'token' is deprecated. Use 'apiKey' instead.` ) ;
26
+ return token ;
27
+ }
33
28
34
29
const getClientConfig = ( options ) => {
35
30
let calculatedOptions = options ;
You can’t perform that action at this time.
0 commit comments