import { Percentage } from "../Percentage" ; export class Index { constructor ( public name , public factsheet , public markets , public sizes , public percentageOfTotalMarketCapitalization , public weighting ) { } public describe ( ) { let markets = this . markets ; let sizes = this . sizes ; if ( markets === 'developed' || markets === 'emerging' ) { markets += ' markets' ; } if ( sizes . includes ( 'large' ) && sizes . includes ( 'mid' ) && sizes . includes ( 'small' ) ) { sizes = [ 'all' ] ; } const weighting = ( this . weighting === 'equal' ? ' equal weighted' : '' ) ; return markets + ' ' + sizes . join ( ' & ' ) + ' cap' + weighting ; } }