Fixing d3/d3.d.ts filter function