mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 08:36:40 +01:00
11 lines
241 B
TypeScript
11 lines
241 B
TypeScript
export function pluralize(word: string, count: number): string {
|
|
if (count === 1) {
|
|
return word;
|
|
}
|
|
return `${word}s`;
|
|
}
|
|
|
|
export function count(word: string, count: number): string {
|
|
return `${count} ${pluralize(word, count)}`;
|
|
}
|