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

Function groupSiblings

source/github-helpers/group-buttons.tsx:33–48  ·  view source on GitHub ↗
(button: Element)

Source from the content-addressed store, hash-verified

31
32// Find immediate `.btn` siblings of `button` and wrap them with groupButtons
33export function groupSiblings(button: Element): Element {
34 const siblings = [button];
35 let previous = button.previousElementSibling;
36 while (previous?.classList.contains('btn')) {
37 siblings.unshift(previous);
38 previous = previous.previousElementSibling;
39 }
40
41 let next = button.nextElementSibling;
42 while (next?.classList.contains('btn')) {
43 siblings.push(next);
44 next = next.nextElementSibling;
45 }
46
47 return groupButtons(siblings);
48}

Callers

nothing calls this directly

Calls 1

groupButtonsFunction · 0.85

Tested by

no test coverage detected