Closed itchyny closed 2 years ago
While undocumented, jq handles null errors as backtracking.
❯ jq -nc '[error], [0, error, 1], error, 1' [] [0,1] 1 ❯ xq -nc '[error], [0, error, 1], error, 1' Error: UserDefinedError("null")
Edit: null | error and error(null) behave as same.
null | error
error(null)
Note the jq behavior of non-string arguments.
❯ jq -n 'try error({ x: 0 }) catch .' { "x": 0 } ❯ jq -n 'try ([{ x: 0 }] | error) catch .' [ { "x": 0 } ] ❯ jq -n 'try error(false) catch .' false
While undocumented, jq handles null errors as backtracking.
Edit:
null | error
anderror(null)
behave as same.