@@ -128,25 +128,23 @@ interface AssumeRoleWithProviderProfile extends Profile {
128
128
credential_source : string ;
129
129
}
130
130
131
- const isAssumeRoleWithSourceProfile = ( arg : any ) : arg is AssumeRoleWithSourceProfile =>
131
+ const isAssumeRoleProfile = ( arg : any ) =>
132
132
Boolean ( arg ) &&
133
133
typeof arg === "object" &&
134
134
typeof arg . role_arn === "string" &&
135
- typeof arg . source_profile === "string" &&
136
- typeof arg . credential_source === "undefined" &&
137
135
[ "undefined" , "string" ] . indexOf ( typeof arg . role_session_name ) > - 1 &&
138
136
[ "undefined" , "string" ] . indexOf ( typeof arg . external_id ) > - 1 &&
139
137
[ "undefined" , "string" ] . indexOf ( typeof arg . mfa_serial ) > - 1 ;
140
138
139
+ const isAssumeRoleWithSourceProfile = ( arg : any ) : arg is AssumeRoleWithSourceProfile =>
140
+ isAssumeRoleProfile ( arg ) &&
141
+ typeof arg . source_profile === "string" &&
142
+ typeof arg . credential_source === "undefined" ;
143
+
141
144
const isAssumeRoleWithProviderProfile = ( arg : any ) : arg is AssumeRoleWithProviderProfile =>
142
- Boolean ( arg ) &&
143
- typeof arg === "object" &&
144
- typeof arg . role_arn === "string" &&
145
+ isAssumeRoleProfile ( arg ) &&
145
146
typeof arg . credential_source === "string" &&
146
- typeof arg . source_profile === "undefined" &&
147
- [ "undefined" , "string" ] . indexOf ( typeof arg . role_session_name ) > - 1 &&
148
- [ "undefined" , "string" ] . indexOf ( typeof arg . external_id ) > - 1 &&
149
- [ "undefined" , "string" ] . indexOf ( typeof arg . mfa_serial ) > - 1 ;
147
+ typeof arg . source_profile === "undefined" ;
150
148
151
149
/**
152
150
* Creates a credential provider that will read from ini files and supports
0 commit comments