ohctechv3/.svn/pristine/92/92917051808bdc24616056b0d25b6c60f11e2414.svn-base
2024-10-28 15:03:36 +05:30

12 lines
285 B
Plaintext

export default function collectElements(node, direction) {
var nextNode = null;
var nodes = [];
nextNode = node ? node[direction] : null;
while (nextNode && nextNode.nodeType !== 9) {
nodes.push(nextNode);
nextNode = nextNode[direction] || null;
}
return nodes;
}