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

Function createLink

source/features/unreleased-commits.tsx:74–94  ·  view source on GitHub ↗
(
	latestTag: string,
	aheadBy: number,
)

Source from the content-addressed store, hash-verified

72});
73
74async function createLink(
75 latestTag: string,
76 aheadBy: number,
77): Promise<HTMLElement> {
78 const commitCount = aheadBy === undeterminableAheadBy
79 ? 'More than 20 unreleased commits'
80 : pluralize(aheadBy, '$$ unreleased commit');
81 const label = `${commitCount}\nsince ${abbreviateString(latestTag, 30)}`;
82
83 return (
84 <a
85 className="btn px-2 tmp-px-2 tooltipped tooltipped-se"
86 href={buildRepoUrl('compare', `${latestTag}...${await getDefaultBranch()}`)}
87 aria-label={label}
88 >
89 <TagIcon />
90 {' '}
91 {aheadBy === undeterminableAheadBy || <sup className="ml-n2 tmp-ml-n2">+{aheadBy}</sup>}
92 </a>
93 );
94}
95
96async function createLinkGroup(latestTag: string, aheadBy: number): Promise<HTMLElement> {
97 const link = await createLink(latestTag, aheadBy);

Callers 2

createLinkGroupFunction · 0.70
addToReleasesFunction · 0.70

Calls 4

pluralizeFunction · 0.85
abbreviateStringFunction · 0.85
buildRepoUrlFunction · 0.85
getDefaultBranchFunction · 0.85

Tested by

no test coverage detected