dfilatov/jspath

Joining properties does not seem to work

hoho opened this issue · 6 comments

hoho commented

Readme promises to understand expressions like (.property1 | .property2 | .propertyN).

I try JSPath.compile('.aa | .bb') and JSPath.compile('(.aa | .bb)') and get Unexpected token "|" and Unexpected token "(" respectively.

0.2.14.

At present there's no way to use join in top level.
But you could easily get what you want:
JSPath.compile('.(.aa | .bb)')

hoho commented

Is it hard to fix?

You aren't first who asks for this so I try to implement.

hoho commented

Sweet! It's logical to have this.

Will be implemented in 0.3

@hoho I've released 0.3.0, could you check whether it works as you expected?