import { regEx } from '../../util/regex' ; import { joinUrlParts } from '../../util/url' ; export const defaultRegistryUrl = 'https://gitlab.com' ; export function getDepHost ( registryUrl = defaultRegistryUrl ) { return registryUrl . replace ( regEx ( /\/api\/v4$/ ) , '' ) ; } export function getSourceUrl ( lookupName , registryUrl ? ) { const depHost = getDepHost ( registryUrl ) ; return joinUrlParts ( depHost , lookupName ) ; }