import { ApiResponseResult } from '../models/api-response' ; function arg export function profanityFilter ( feeds ) { const filteredFeeds = [ ] ; feeds . forEach ( ( feed ) => { if ( feed . classifier_profanity !== null && feed . classifier_profanity !== undefined ) { if ( feed . classifier_profanity !== 'sex' && feed . classifier_profanity !== 'swear' ) { filteredFeeds . push ( feed ) ; } } else { filteredFeeds . push ( feed ) ; } } ) ; return filteredFeeds || feeds ; } function arg arg export function accountExclusion ( feeds , userId ) { const filteredFeeds = [ ] ; let flag ; feeds . forEach ( ( feed ) => { flag = false ; userId . forEach ( ( user ) => { if ( feed . user . user_id === user ) { flag = true ; } } ) ; if ( ! flag ) { filteredFeeds . push ( feed ) ; } } ) ; return filteredFeeds || feeds ; } export function hideFeed ( feeds , statusId ) { const filteredFeeds = [ ] ; feeds . forEach ( ( feed ) => { if ( feed . id_str !== statusId ) { filteredFeeds . push ( feed ) ; } } ) ; return filteredFeeds || feeds ; } export function showFeed ( originalFeeds , feeds , statusId ) { const newFeeds = [ ... feeds ] ; originalFeeds . forEach ( ( feed ) => { if ( feed . id_str === statusId ) { newFeeds . push ( feed ) ; } } ) ; return newFeeds ; } export function removeId ( originalIds , id ) { const newIds = [ ] ; originalIds . forEach ( ( originalId ) => { if ( originalId !== id ) { newIds . push ( id ) ; } } ) ; return newIds ; } export function accountInclusion ( originalFeeds , feeds , userId ) { const newFeeds = [ ... feeds ] ; originalFeeds . forEach ( ( feed ) => { if ( feed . user . user_id === userId ) { newFeeds . push ( feed ) ; } } ) ; return newFeeds ; } export function removeDuplicateCheck ( feeds ) { const map = { } ; const filteredFeeds = [ ] ; let v ; for ( let a = 0 ; a < feeds . length ; a ++ ) { v = feeds [ a ] . id_str ; if ( ! map [ v ] ) { filteredFeeds . push ( feeds [ a ] ) ; map [ v ] = true ; } } return filteredFeeds ; }