src/utils.ts hinzugefügt

This commit is contained in:
ds
2026-06-28 18:38:07 +00:00
parent 7c59b56c80
commit 67ba5fd7b9
+15
View File
@@ -0,0 +1,15 @@
export function matchesRegex(line: string, regex: string) {
if (!regex) return true;
try {
return new RegExp(regex, "i").test(line);
} catch {
return true;
}
}
export function highlight(line: string) {
return line
.replace(/error/gi, "🔴 ERROR")
.replace(/warn/gi, "🟡 WARN")
.replace(/info/gi, "🔵 INFO");
}