Build an AST (JSON object) from a logic expression string
const logicExpression = 'a AND b OR c';
const bracketTree = new BracketTree(logicExpression);
const logicTree = new LogicTree(bracketTree.nodes, bracketTree.text).getAst();
console.log(logicTree);
{
name: 'node0',
content: 'a AND b OR c',
orParams: [{
text: 'a AND b',
andParams: [{ name: 'a' }, { name: 'b' }]
}, {
text: 'c',
andParams: [{ name: 'c' }]
}]
}