15 lines
312 B
TypeScript
Raw Normal View History

const specialized = {
"new activity": "new activities"
}
2018-04-02 05:34:16 +00:00
export 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"
2018-04-02 05:34:16 +00:00
}