wewriteapps/JPath — pull request #3 by mcw0933 (2013-07-19 16:03:31+00:00)
Title: added ! operator for boolean properties (e.g. [!newItem])

Hi - I was running into some issues where we extended the Array prototype with some additional functions. Those functions were showing up in the results of the calls to f.

Normally this wasn't a problem, I guess, because the evaluator would look for the .json property of the result, which was null.

But when I tried to implement a query against a boolean property, and tried [!newItem] as the syntax, the call would expand to return !($('newItem').json)... which is "! null", and so the custom functions would show up.

I put in an additional regex to switch a literal ! to "false === ", which should do the trick.