import { TierRank , TierDivision } from '../types' ; export const getTierString = ( tier ) : string => { const tierRankList = [ 'Bronze' , 'Silver' , 'Gold' , 'Platinum' , 'Diamond' , 'Ruby' , 'Master' , ] ; const tierDivisionList = [ 'I' , 'II' , 'III' , 'IV' , 'V' ] ; if ( tier ) { const tierRank = tierRankList [ Math . floor ( ( tier - 1 ) / 5 ) ] ; const tierDivision = tierDivisionList [ 4 - ( ( tier - 1 ) % 5 ) ] ; if ( tierRank === 'Master' ) { return tierRank ; } return [ tierRank , tierDivision ] . join ( ' ' ) ; } return 'Unrated' ; } ; export const getTierRank = ( tier ) : TierRank => { const tierRankList = [ 'Bronze' , 'Silver' , 'Gold' , 'Platinum' , 'Diamond' , 'Ruby' , 'Master' , ] ; return tier ? tierRankList [ Math . floor ( ( tier - 1 ) / 5 ) ] : 'Unrated' ; } ;