sim0n00ps 141839d329
Some checks failed
Publish Docker image / Push docker image to registry (push) Failing after 5s
Publish release zip / build (push) Failing after 57s
Include node_modules for local Gitea action
2025-05-04 19:22:56 +01:00

30 lines
495 B
JavaScript

'use strict'
const singulars = {
pronoun: 'it',
is: 'is',
was: 'was',
this: 'this'
}
const plurals = {
pronoun: 'they',
is: 'are',
was: 'were',
this: 'these'
}
module.exports = class Pluralizer {
constructor (singular, plural) {
this.singular = singular
this.plural = plural
}
pluralize (count) {
const one = count === 1
const keys = one ? singulars : plurals
const noun = one ? this.singular : this.plural
return { ...keys, count, noun }
}
}