feat: pluralize things in lists

This commit is contained in:
Jacky Zhao 2023-09-02 18:07:26 -07:00
parent 23f43045c4
commit 505673acd7
3 changed files with 12 additions and 3 deletions
quartz/util

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`
}
}