type Constructor < T > = new ( ... args ) => T ; export function filterByType < TElements , TFilter extends TElements > ( array , filterType ) { return < TFilter [ ] > array . filter ( e => e instanceof filterType ) ; }