feat: pluralize things in lists

This commit is contained in:
Jacky Zhao
2023-09-02 18:07:26 -07:00
parent 53dd86727b
commit c7cd941e5f
3 changed files with 12 additions and 3 deletions

7
quartz/util/lang.ts Normal file
View File

@@ -0,0 +1,7 @@
export function pluralize(count: number, s: string): string {
if (count === 1) {
return `1 ${s}`
} else {
return `${count} ${s}s`
}
}