summaryrefslogtreecommitdiff
path: root/source/helpers/pluralize.ts
diff options
context:
space:
mode:
authorGravatar Federico <me@fregante.com> 2020-11-21 13:27:14 -0600
committerGravatar GitHub <noreply@github.com> 2020-11-21 13:27:14 -0600
commitc99595dc4755c99a6aa05a237c952bc1d9c08dfb (patch)
tree9244ead59ed89b09cb07e60f93d0271d2edfd724 /source/helpers/pluralize.ts
parent1bedcd71886ac9c20bf91a6d48e428622ab6d1b1 (diff)
downloadrefined-github-c99595dc4755c99a6aa05a237c952bc1d9c08dfb.tar.gz
refined-github-c99595dc4755c99a6aa05a237c952bc1d9c08dfb.tar.zst
refined-github-c99595dc4755c99a6aa05a237c952bc1d9c08dfb.zip
Add `quick-fork-deletion` feature (#3734)
Diffstat (limited to 'source/helpers/pluralize.ts')
-rw-r--r--source/helpers/pluralize.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/helpers/pluralize.ts b/source/helpers/pluralize.ts
index e0ed4e33..d90d6ca5 100644
--- a/source/helpers/pluralize.ts
+++ b/source/helpers/pluralize.ts
@@ -1,4 +1,13 @@
-export default function pluralize(count: number, single: string, plural: string, zero?: string): string {
+function regular(single: string): string {
+ return single + 's';
+}
+
+export default function pluralize(
+ count: number,
+ single: string,
+ plural = regular(single),
+ zero?: string
+): string {
if (count === 0 && zero) {
return zero.replace('$$', '0');
}