Closed jamie-pate closed 3 years ago
Additionally,
$[property]
works in the path, but [?(@[property] == 'value')]
does not?
This should now be fixed in 5.1.0 so closing. Feel free to comment further. For your other comment, feel free to file a separate issue, but as this project is not too well-maintained and is a bit hard to navigate given its frequent use of regexes rather than easily documented parsing routines, I tend to only grab the low-hanging fruit such as this issue.
Even for issues that don't get fixed it's often helpful to have it noted since users can confirm the issue that are facing has been encountered before and share workarounds etc :)
Also the $[property]
syntax is just strange, not sure it warrants an actual issue. Definitely doesn't seem like something you'd want to hack into static-eval
I guess the follow up is: what is the npm release schedule? Seems like 5.0.7 is the latest on npm?
.. no.. wait... 5.1.0 • Public • Published 4 hours ago 🥴
Yes, after your fix in 5.0.7, we added the enhancement for supporting double-quoted bracket notation. If you were pegging to the patch version 5.0.7 should work, but if you want the latest and hopefully greatest, 5.1.0 is available.
Describe the bug
When accessing properties using array notation, you can use
'
but not"
to enclose the property name. This would be fine, except that"
can be used within the query expression and it makes it confusing.Code sample or steps to reproduce
https://stackblitz.com/edit/js-rq1fmy?file=index.js
Console error or logs
Expected behavior
as in JavaScript,
"
should be usable to quote property names. E.G:{ property: 'value' }
+$["property"]
>["value"]
. This would make it consistent between the path expression and query expression.Environment (IMPORTANT)
Desktop
Additional context