From 2fadb6802de640d692fdab7d654311df0d7b4836 Mon Sep 17 00:00:00 2001 From: release-bot Date: Sun, 8 Feb 2026 21:58:01 +0100 Subject: [PATCH] refactor: make changelog code simpler --- app/src/lib/sidebar/panels/Changelog.svelte | 23 ++++----------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/app/src/lib/sidebar/panels/Changelog.svelte b/app/src/lib/sidebar/panels/Changelog.svelte index 6d280b9..3c11f41 100644 --- a/app/src/lib/sidebar/panels/Changelog.svelte +++ b/app/src/lib/sidebar/panels/Changelog.svelte @@ -22,25 +22,10 @@ ]); function detectCommitType(commit: string) { - if (commit.startsWith('fix:') || commit.startsWith('fix(')) { - return 'fix'; - } - - if (commit.startsWith('feat:') || commit.startsWith('feat(')) { - return 'feat'; - } - - if (commit.startsWith('chore:') || commit.startsWith('chore(')) { - return 'chore'; - } - if (commit.startsWith('docs:') || commit.startsWith('docs(')) { - return 'docs'; - } - if (commit.startsWith('refactor:') || commit.startsWith('refactor(')) { - return 'refactor'; - } - if (commit.startsWith('ci:') || commit.startsWith('ci(')) { - return 'ci'; + for (const key of typeMap.keys()) { + if (commit.startsWith(key)) { + return key; + } } return ''; }