import Filter from 'bad-words' ; const filter = new Filter ( ) ; export default function filterBadWords ( text ) { if ( text === '' || ! text ) return ; text = text . split ( '' ) . filter ( c => c . charCodeAt ( 0 ) !== 8203 ) . join ( '' ) ; return filter . clean ( text ) ; }