(button: Element)
| 31 | |
| 32 | // Find immediate `.btn` siblings of `button` and wrap them with groupButtons |
| 33 | export 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 | } |
nothing calls this directly
no test coverage detected