UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

15 lines (14 loc) 486 B
import { isHTMLElement } from "@1771technologies/lytenyte-shared"; import { isBranchNode } from "./is-branch-node.js"; export function getSiblingBranches(el) { const children = el.parentElement?.children; if (!children) return; const branchSiblings = []; for (let i = 0; i < children.length; i++) { const node = children[i]; if (isHTMLElement(node) && isBranchNode(node)) branchSiblings.push(node); } return branchSiblings; }