Skip to content

Commit 83a7eef

Browse files
committed
chore: Sort thanks in changelog
1 parent 371e035 commit 83a7eef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/generate_changelog.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ function getThanks(commits) {
154154
thanks.delete(person);
155155
}
156156

157-
return thanks;
157+
return [...thanks].sort((a, b) =>
158+
a.localeCompare(b, "en-us", { sensitivity: "base" })
159+
);
158160
}
159161

160162
/**
@@ -246,8 +248,8 @@ function getBody(commits, target) {
246248
}
247249

248250
const thanks = getThanks(commits);
249-
if (thanks.size) {
250-
lines.push(`### Thanks!`, "", ...[...thanks].map((t) => ` * ${t}`), "");
251+
if (thanks.length > 0) {
252+
lines.push(`### Thanks!`, "", ...thanks.map((t) => ` * ${t}`), "");
251253
}
252254

253255
lines.pop();

0 commit comments

Comments
 (0)