refactor: make changelog code simpler
This commit is contained in:
@@ -22,25 +22,10 @@
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
function detectCommitType(commit: string) {
|
function detectCommitType(commit: string) {
|
||||||
if (commit.startsWith('fix:') || commit.startsWith('fix(')) {
|
for (const key of typeMap.keys()) {
|
||||||
return 'fix';
|
if (commit.startsWith(key)) {
|
||||||
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user