You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to add a .skip() function that skips looking at the descendants of only the current node and an up function that does the same, but also skips looking at the next siblings:
node.forEachDescendant((node,traversal)=>{console.log(node.getText());if(someCondition)traversal.stop();elseif(otherCondition)traversal.skip();// skip looking at the descendantselseif(otherCondition2)traversal.up();// skip and go back up the tree to the parent's next sibling});
Right now,
forEachDescendant
looks like this:It would be nice to add a
.skip()
function that skips looking at the descendants of only the current node and anup
function that does the same, but also skips looking at the next siblings:Inspired by: https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md#stopping-traversal
The text was updated successfully, but these errors were encountered: