1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +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', name: 'search',
}) })
export class SearchPipe implements PipeTransform { 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) { if (items == null || items.length === 0) {
return []; return [];
} }
@ -24,6 +24,9 @@ export class SearchPipe implements PipeTransform {
if (prop2 != null && i[prop2] != null && i[prop2].toString().toLowerCase().indexOf(searchText) > -1) { if (prop2 != null && i[prop2] != null && i[prop2].toString().toLowerCase().indexOf(searchText) > -1) {
return true; return true;
} }
if (prop3 != null && i[prop3] != null && i[prop3].toString().toLowerCase().indexOf(searchText) > -1) {
return true;
}
return false; return false;
}); });
} }