diff --git a/lib/utils/text-utils.js b/lib/utils/text-utils.js --- a/lib/utils/text-utils.js +++ b/lib/utils/text-utils.js @@ -9,19 +9,16 @@ } else if (nouns.length === 1) { return nouns[0]; } else if (maxNumberOfNouns === 1) { - return `${nouns.length} ${nouns.length > 1 ? 'users' : 'user'}`; + return `${nouns.length} users`; } const comma = maxNumberOfNouns > 2 && nouns.length > 2 ? ',' : ''; if (nouns.length <= maxNumberOfNouns) { const prefix = nouns.slice(0, -1).join(', '); return `${prefix}${comma} and ${nouns[nouns.length - 1]}`; - } else { - const prefix = nouns.slice(0, maxNumberOfNouns - 1).join(', '); - return `${prefix}${comma} and ${ - nouns.length - maxNumberOfNouns + 1 - } others`; } + const prefix = nouns.slice(0, maxNumberOfNouns - 1).join(', '); + return `${prefix}${comma} and ${nouns.length - maxNumberOfNouns + 1} others`; } function trimText(text: string, maxLength: number): string {