blob: 1d0cc766bc44ba1fda056b1d8688887057ac8526 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
pragma Singleton
import Quickshell
Singleton {
function testRegexList(filterList: list<string>, target: string): bool {
const regexChecker = /^\^.*\$$/;
for (const filter of filterList) {
// If filter is a regex
if (regexChecker.test(filter)) {
if ((new RegExp(filter)).test(target))
return true;
} else {
if (filter === target)
return true;
}
}
return false;
}
}
|