1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-26 17:08:33 +01:00

allow prop 3 search

This commit is contained in:
Kyle Spearrin 2018-07-06 15:03:00 -04:00
parent 7b23b90054
commit c44e633f42

View File

@ -7,7 +7,7 @@ import {
name: 'search',
})
export class SearchPipe implements PipeTransform {
transform(items: any[], searchText: string, prop1?: string, prop2?: string): any[] {
transform(items: any[], searchText: string, prop1?: string, prop2?: string, prop3?: string): any[] {
if (items == null || items.length === 0) {
return [];
}
@ -24,6 +24,9 @@ export class SearchPipe implements PipeTransform {
if (prop2 != null && i[prop2] != null && i[prop2].toString().toLowerCase().indexOf(searchText) > -1) {
return true;
}
if (prop3 != null && i[prop3] != null && i[prop3].toString().toLowerCase().indexOf(searchText) > -1) {
return true;
}
return false;
});
}