File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @radarlabs/api-diff" ,
3
- "version" : " 1.0.35 " ,
3
+ "version" : " 1.0.36 " ,
4
4
"description" : " " ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -125,10 +125,23 @@ export function findApiKey(
125
125
* @returns {ApiEnv } filled in ApiEnv
126
126
*/
127
127
export function argvToApiEnv (
128
- argv : Partial < ApiEnv > | undefined ,
128
+ argv ?: any ,
129
129
exitOnFailure ?: boolean ,
130
130
) : ApiEnv {
131
- let apiEnv : Partial < ApiEnv > = _ . clone ( argv ) || { } ;
131
+ let apiEnv : Partial < ApiEnv > = { } ;
132
+
133
+ if ( argv . key ) {
134
+ apiEnv . key = argv . key ;
135
+ }
136
+ if ( argv . host ) {
137
+ apiEnv . host = argv . host ;
138
+ }
139
+ if ( argv . key_env ) {
140
+ apiEnv . keyEnv = argv . key_env ;
141
+ }
142
+ if ( argv . keyType ) {
143
+ apiEnv . keyType = argv . key_type ;
144
+ }
132
145
133
146
let aliasedHostEntry : ConfigHostEntry ;
134
147
_ . forEach ( config . hosts , ( hostEntry : ConfigHostEntry , hostKey : string ) => {
@@ -155,7 +168,7 @@ export function argvToApiEnv(
155
168
// keyEnv is either the env specified in the hostEntry or just the
156
169
// name of the hostConfig. For example, localhost might specify keyEnv: staging,
157
170
// while the hostConfig for "staging" wouldn't need to do so
158
- hostEntry . keyEnv = argv . keyEnv || hostEntry . keyEnv || hostKey ;
171
+ hostEntry . keyEnv = hostEntry . keyEnv || hostKey ;
159
172
160
173
hostEntry . keyType = hostEntry . keyType || _ . first ( config . keyTypes ) ;
161
174
You can’t perform that action at this time.
0 commit comments