Skip to content

Commit 2df90e0

Browse files
committed
fix: sort csv before output
1 parent aec4083 commit 2df90e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/scripts/crowdin/reports/wordsNeedingReview.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ async function main() {
5757
})
5858
}
5959

60+
// Sort first by language code, then by bucket name
61+
const sorted = reportSummary.sort((a, b) =>
62+
a[0] === b[0] ? a[1].localeCompare(b[1]) : a[0].localeCompare(b[0])
63+
)
6064
// Transform to çsv string
61-
const csvArray = reportSummary.map((item) => item.join(","))
65+
const csvArray = sorted.map((item) => item.join(","))
6266
// Insert header names at beginning of csv array
6367
csvArray.unshift("Language,Bucket Name,Words needing review")
6468
const csv = csvArray.join("\n")

0 commit comments

Comments
 (0)