16 lines
321 B
TypeScript
Raw Normal View History

const specialized = {
"new activity": "new activities"
}
2019-11-18 02:04:13 +00:00
export default function plural(count: number, singular: string): string {
if(count === 1 || count === -1) {
return count + " " + singular
}
if(specialized[singular]) {
return count + " " + specialized[singular]
}
return count + " " + singular + "s"
2019-11-17 09:44:30 +00:00
}