import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
    name: 'autocom'
})
export class SearchAutoPipeV2 implements PipeTransform {

    transform(items: any[], searchText: string,key = 'display'): any[] {
        if(!items) return
        if (!searchText) return items;
        return items.filter((item) => item[key].includes(searchText.toLowerCase()) || item[key].includes(searchText.toUpperCase()))
     }
}
