import ChannelModel from '@/Model/channel' ; class ChannelParser { public static parse ( channels ) { if ( channels ) { channels . forEach ( ( channel ) => { ChannelParser . channels . push ( new ChannelModel ( channel . id , channel . name , channel . icon ) ) ; } ) ; } } public static getChannels ( channels ) { return ChannelParser . channels . filter ( ( model ) => { channels . forEach ( ( channel ) => { return model . getId ( ) === channel ; } ) ; } ) ; } private static channels : ChannelModel [ ] = [ ] ; } export default ChannelParser ;