formats.exposed/public/common/pluralize.js

14 lines
247 B
JavaScript

// @ts-check
/**
* Pluralize an English string.
* @param {number} count
* @param {string} noun
* @returns {string}
*/
export default (count, noun) => {
let result = count + " " + noun;
if (count !== 1) result += "s";
return result;
};