Merge "Case insensitive filter on winscope"
This commit is contained in:
committed by
Android (Google) Code Review
commit
697db8c073
@@ -437,11 +437,11 @@ function getFilter(filterString) {
|
||||
const negative = [];
|
||||
filterStrings.forEach((f) => {
|
||||
if (f.startsWith('!')) {
|
||||
const str = f.substring(1);
|
||||
negative.push((s) => s.indexOf(str) === -1);
|
||||
const regex = new RegExp(f.substring(1), "i");
|
||||
negative.push((s) => !regex.test(s));
|
||||
} else {
|
||||
const str = f;
|
||||
positive.push((s) => s.indexOf(str) !== -1);
|
||||
const regex = new RegExp(f, "i");
|
||||
positive.push((s) => regex.test(s));
|
||||
}
|
||||
});
|
||||
const filter = (item) => {
|
||||
|
||||
@@ -236,10 +236,13 @@ export default {
|
||||
filteredData = filteredData.filter(
|
||||
this.filterTransactions((transaction) => {
|
||||
for (const filter of this.filters) {
|
||||
if (isNaN(filter) && transaction.layerName?.includes(filter)) {
|
||||
// If filter isn't a number then check if the transaction's
|
||||
// target surface's name matches the filter — if so keep it.
|
||||
return true;
|
||||
if (isNaN(filter)) {
|
||||
// If filter isn't a number then check if the transaction's
|
||||
// target surface's name matches the filter — if so keep it.
|
||||
const regexFilter = new RegExp(filter, "i");
|
||||
if (regexFilter.test(transaction.layerName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (filter == transaction.obj.id) {
|
||||
// If filteter is a number then check if the filter matches
|
||||
|
||||
Reference in New Issue
Block a user