mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-29 14:36:22 +00:00
8 lines
148 B
TypeScript
8 lines
148 B
TypeScript
|
export function pluralize(count: number, s: string): string {
|
||
|
if (count === 1) {
|
||
|
return `1 ${s}`
|
||
|
} else {
|
||
|
return `${count} ${s}s`
|
||
|
}
|
||
|
}
|