import * as _ from "lodash"; import {Pipe, PipeTransform} from "@angular/core"; @Pipe({ name: "datasetTableFilter" }) export class DatasetTableFilterPipe implements PipeTransform { transform(array: any[], query: string): any { if (query) { return _.filter(array, row => { if (row.uri == null) row.uri = ""; if (row.label == null) row.label = ""; if (row.id == null) row.id = ""; return ( row.label.indexOf(query) > -1 //|| row.version == query //|| row.id.indexOf(query) > -1 ) }); } return array; } }