mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-03 07:18:14 +00:00
feat: pluralize things in lists
This commit is contained in:
parent
23f43045c4
commit
505673acd7
3 changed files with 12 additions and 3 deletions
quartz/util
7
quartz/util/lang.ts
Normal file
7
quartz/util/lang.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export function pluralize(count: number, s: string): string {
|
||||
if (count === 1) {
|
||||
return `1 ${s}`
|
||||
} else {
|
||||
return `${count} ${s}s`
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue