While we could parse the expression into object. I wish that we should be able to also reconstruct the object that was parsed back to expression. So I could write editor and perform some editing, or just partially reconstruct the subexpression into string text
Suppose I have expression propertyA.valueA > `10`
var expression0 = "propertyA.valueA > `10`";
var parsed = jmespath.parse(expression0);
parsed.name = parsed.name == "GT" ? "LT" : "GT";
var expression1 = jmespath.reconstruct(parsed); // became "propertyA.valueA < `10`";
var subExpression = jmespath.reconstruct(parsed.children[0]); // get "propertyA.valueA"
parsed.children[0].name = subExpression == "propertyA.valueA" ? "propertyB.valueB" : "propertyA.valueA";
var expression2 = jmespath.reconstruct(parsed); // became "propertyB.valueB < `10`";
Is it already possible? If not I would like to have this be feature request
While we could parse the expression into object. I wish that we should be able to also reconstruct the object that was parsed back to expression. So I could write editor and perform some editing, or just partially reconstruct the subexpression into string text
Suppose I have expression
propertyA.valueA > `10`
Is it already possible? If not I would like to have this be feature request