This repository has been archived on 2024-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
quartz-wiki/quartz/util/lang.ts
2024-01-10 14:39:54 +08:00

12 lines
257 B
TypeScript

export function pluralize(count: number, s: string): string {
if (count === 1) {
return `1 ${s}`
} else {
return `${count} ${s}s`
}
}
export function capitalize(s: string): string {
return s.substring(0, 1).toUpperCase() + s.substring(1)
}