From 67ba5fd7b9ae99adef74965f1565677c4f142a48 Mon Sep 17 00:00:00 2001 From: ds Date: Sun, 28 Jun 2026 18:38:07 +0000 Subject: [PATCH] =?UTF-8?q?src/utils.ts=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils.ts diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..a8c305e --- /dev/null +++ b/src/utils.ts @@ -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"); +} \ No newline at end of file