mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-04-11 09:36:46 +00:00
21 lines
526 B
QML
21 lines
526 B
QML
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;
|
|
}
|
|
}
|