keroosha.cybergulag.today/quartz/util/lang.ts

8 lines
148 B
TypeScript
Raw Normal View History

2023-09-03 04:07:26 +03:00
export function pluralize(count: number, s: string): string {
if (count === 1) {
return `1 ${s}`
} else {
return `${count} ${s}s`
}
}