@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
15 lines (13 loc) • 332 B
JavaScript
function getBranchValues(tree, depth) {
let values = [];
tree.visit({
onEnter: (node, indexPath) => {
if (indexPath.length === 0) return;
if (tree.isBranchNode(node) && indexPath.length <= depth) {
values.push(tree.getNodeValue(node));
}
}
});
return values;
}
export { getBranchValues };