Add `enter` callback as a second .traverse arg
a-x- opened this issue · 0 comments
a-x- commented
I suggest making the .traverse method more polymorphic.
is it cool to write:
traverse.traverse(ast, node => isBemjson(node) && bemjsons.push(this.nodeToObject(node)));
insted of:
traverse.traverse(ast, {
enter: node => isBemjson(node) && bemjsons.push(this.nodeToObject(node))
});