MCPcopy Index your code
hub / github.com/refined-github/refined-github / pluralize

Function pluralize

source/helpers/pluralize.ts:5–20  ·  view source on GitHub ↗
(
	count: number,
	single: string,
	plural = regular(single),
	zero?: string,
)

Source from the content-addressed store, hash-verified

3}
4
5export default function pluralize(
6 count: number,
7 single: string,
8 plural = regular(single),
9 zero?: string,
10): string {
11 if (count === 0 && zero) {
12 return zero.replace('$$', '0');
13 }
14
15 if (count === 1) {
16 return single.replace('$$', '1');
17 }
18
19 return plural.replace('$$', String(count));
20}

Callers 10

pluralize.test.tsFile · 0.85
bisectFeaturesFunction · 0.85
openTabsFunction · 0.85
createLinkFunction · 0.85
addToNewReleaseFunction · 0.85
getBaseCommitNoticeFunction · 0.85
initHeadHintFunction · 0.85
initDeleteHintFunction · 0.85
openUnreadNotificationsFunction · 0.85
addFunction · 0.85

Calls 2

regularFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected