MCPcopy
hub / github.com/refined-github/refined-github / parseReference

Function parseReference

source/github-helpers/pr-branches.ts:55–64  ·  view source on GitHub ↗
(referenceElement: HTMLElement)

Source from the content-addressed store, hash-verified

53}
54
55function parseReference(referenceElement: HTMLElement): PrReference {
56 const {title, textContent, nextElementSibling} = referenceElement;
57
58 // In the old React version, we have a `title` attribute but it's used to mark deleted repos instead
59 // eslint-disable-next-line unicorn/prefer-minimal-ternary -- It will be removed soon ish
60 return title && title !== 'This repository has been deleted'
61 // TODO [2026-06-01]: Remove
62 ? parseReferenceRaw(title, textContent.trim())
63 : parseReferenceRaw(nextElementSibling!.textContent.trim(), textContent.trim());
64}
65
66export function getBranches(): {base: PrReference; head: PrReference} {
67 return {

Callers 2

baseFunction · 0.85
headFunction · 0.85

Calls 1

parseReferenceRawFunction · 0.85

Tested by

no test coverage detected