Files
yaak-mountain-loop/src-web/lib/pluralize.ts
2023-11-09 09:28:01 -08:00

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