MCPcopy Create free account
hub / github.com/code-pushup/cli / pluralize

Function pluralize

tools/eslint-formatter-multi/src/lib/stylish.ts:22–24  ·  view source on GitHub ↗

* Given a word and a count, append an s if count is not one. * @param {string} word A word in its singular form. * @param {number} count A number controlling whether word should be pluralized. * @returns {string} The original word with an s on the end if count is not one.

(word: string, count: number)

Source from the content-addressed store, hash-verified

20 * @returns {string} The original word with an s on the end if count is not one.
21 */
22function pluralize(word: string, count: number): string {
23 return count === 1 ? word : `${word}s`;
24}
25
26//------------------------------------------------------------------------------
27// Public Interface

Callers 1

stylishFormatterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected