added audio and apps page in settings
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
property var _regexCache: ({})
|
||||
|
||||
function testRegexList(filterList: list<string>, target: string): bool {
|
||||
const regexChecker = /^\^.*\$$/;
|
||||
for (const filter of filterList) {
|
||||
if (regexChecker.test(filter)) {
|
||||
let re = _regexCache[filter];
|
||||
if (!re) {
|
||||
re = new RegExp(filter);
|
||||
_regexCache[filter] = re;
|
||||
}
|
||||
if (re.test(target))
|
||||
return true;
|
||||
} else {
|
||||
if (filter === target)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user