import { RepositoryKind } from '../types' ; import { getRepoKindName } from './repoKind' ; interface MinRepository { kind : RepositoryKind ; name : string ; } const buildPackageURL = ( normalizedName , repository , version ? , withVersion ? ) : string => { let url = `/packages/${ getRepoKindName ( repository . kind ) ! }/${ repository . name }/${ normalizedName }` ; if ( version && withVersion ) { url += `/${ version }` ; } return url ; } ; export default buildPackageURL ;