You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If running a jq filter produces an empty result, the result is an empty string ('') even if the output option is set to json.
It may be a bit confusing because an empty string is also a different valid result (see examples below).
// this filter yields no resultsjq.run('select(.foo == "bar")',{foo: ""},{input: "json",output: "json"}).then(result=>{// result is an empty string ''});// this filter yields an empty stringjq.run('.foo',{foo: ""},{input: "json",output: "json"}).then(result=>{// result is an empty string ''});
I believe that undefined would be a better option because it is used neither in JSON nor in JQ.