@@ -37,7 +37,7 @@ const builtInProviders: RemoteProviders = [
3737 {
3838 custom : false ,
3939 matcher : 'gitlab.com' ,
40- creator : ( _container : Container , domain : string , path : string ) => new GitLabRemote ( domain , path ) ,
40+ creator : ( container : Container , domain : string , path : string ) => new GitLabRemote ( container , domain , path ) ,
4141 } ,
4242 {
4343 custom : false ,
@@ -52,7 +52,7 @@ const builtInProviders: RemoteProviders = [
5252 {
5353 custom : false ,
5454 matcher : / \b g i t l a b \b / i,
55- creator : ( _container : Container , domain : string , path : string ) => new GitLabRemote ( domain , path ) ,
55+ creator : ( container : Container , domain : string , path : string ) => new GitLabRemote ( container , domain , path ) ,
5656 } ,
5757 {
5858 custom : false ,
@@ -77,13 +77,16 @@ const builtInProviders: RemoteProviders = [
7777 } ,
7878] ;
7979
80- const cloudRemotesMap : Record <
80+ const cloudProviderCreatorsMap : Record <
8181 CloudSelfHostedIntegrationId ,
82- typeof GitHubRemote | typeof GitLabRemote | typeof BitbucketServerRemote
82+ ( container : Container , domain : string , path : string ) => RemoteProvider
8383> = {
84- [ SelfHostedIntegrationId . CloudGitHubEnterprise ] : GitHubRemote ,
85- [ SelfHostedIntegrationId . CloudGitLabSelfHosted ] : GitLabRemote ,
86- [ SelfHostedIntegrationId . BitbucketServer ] : BitbucketServerRemote ,
84+ [ SelfHostedIntegrationId . CloudGitHubEnterprise ] : ( _container : Container , domain : string , path : string ) =>
85+ new GitHubRemote ( domain , path ) ,
86+ [ SelfHostedIntegrationId . CloudGitLabSelfHosted ] : ( container : Container , domain : string , path : string ) =>
87+ new GitLabRemote ( container , domain , path ) ,
88+ [ SelfHostedIntegrationId . BitbucketServer ] : ( _container : Container , domain : string , path : string ) =>
89+ new BitbucketServerRemote ( domain , path ) ,
8790} ;
8891
8992export function loadRemoteProviders (
@@ -118,12 +121,10 @@ export function loadRemoteProviders(
118121 const integrationId = ci . integrationId ;
119122 if ( isCloudSelfHostedIntegrationId ( integrationId ) && ci . domain ) {
120123 const matcher = ci . domain . toLocaleLowerCase ( ) ;
121- const providerCreator = ( _container : Container , domain : string , path : string ) : RemoteProvider =>
122- new cloudRemotesMap [ integrationId ] ( domain , path ) ;
123124 const provider = {
124125 custom : false ,
125126 matcher : matcher ,
126- creator : providerCreator ,
127+ creator : cloudProviderCreatorsMap [ integrationId ] ,
127128 } ;
128129
129130 const indexOfCustomDuplication : number = providers . findIndex ( p => p . matcher === matcher ) ;
@@ -169,8 +170,8 @@ function getCustomProviderCreator(cfg: RemotesConfig) {
169170 return ( _container : Container , domain : string , path : string ) =>
170171 new GitHubRemote ( domain , path , cfg . protocol , cfg . name , true ) ;
171172 case 'GitLab' :
172- return ( _container : Container , domain : string , path : string ) =>
173- new GitLabRemote ( domain , path , cfg . protocol , cfg . name , true ) ;
173+ return ( container : Container , domain : string , path : string ) =>
174+ new GitLabRemote ( container , domain , path , cfg . protocol , cfg . name , true ) ;
174175 default :
175176 return undefined ;
176177 }
0 commit comments