src/utils.ts hinzugefügt
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user