export function filterAndMap < C , R > ( array , filter , map ) { return array . reduce < R [ ] > ( ( filtered , current ) => { if ( filter ( current , filtered ) ) { filtered . push ( map ( current , filtered ) ) ; } return filtered ; } , [ ] ) ; }