-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jq options #9
Comments
Although it is already possible to call jq with arguments (I just don't document it because it doesn't work for most arguments) I believe your case will be nicely served by |
@fiatjaf thx for the fast reply! Wanted to have it here: https://github.com/zalando-incubator/bro-q/blob/master/src/ts/background.js#L4 |
Have you tried this? function getJq(jsonInput, filter = '.') {
- return jq(JSON.parse(jsonInput), filter);
+ return jq.raw(jsonInput, filter);
} |
Actually, since your case doesn't need synchronous application of the function, you should use |
@fiatjaf I thought I did but I will try again, maybe I have some other issues Thanks also for the tipp with promised, this was an hackweek project and I'm actually a java backend dev trying to get into something new :) |
from looking at generated code, the third parameter is for options. but it's "sticky", once applied it somehow stays there. so calling next time with example window.jq.raw('{"a":"b\\nc"}','.a', [])
""b\nc""
window.jq.raw('{"a":"b\\nc"}','.a', ["--raw-output"])
"b
c"
window.jq.raw('{"a":"b\\nc"}','.a', [])
"b |
Hi,
would be possible to add also the options via the jq function like jq(, , )?
we will need it for example for the option "-r"
Thanks! :)
PS: here is what we are building with your library https://github.com/zalando-incubator/bro-q
The text was updated successfully, but these errors were encountered: