01mf02 / jaq

A jq clone focussed on correctness, speed, and simplicity
MIT License
2.61k stars 63 forks source link

[bug] `map_values(@base64d)` results in `undefined filter` #192

Closed lukehsiao closed 1 week ago

lukehsiao commented 2 weeks ago

This command used to work for us in v1.4.0

❯ echo '{"a": "aGVsbG8=", "b": "d29ybGQ="}' | jaq "map_values(@base64d)"
Error: undefined filter
  ╭─
  │
1 │ map_values(@base64d)
  ┆            ────┬───
  ┆                │
  ┆                ╰───── undefined filter
──╯
❯ jaq --version
jaq 1.5.0

But doesn't anymore in v1.5.0. The same command does still work with jq.

❯ echo '{"a": "aGVsbG8=", "b": "d29ybGQ="}' | jq "map_values(@base64d)"
{
  "a": "hello",
  "b": "world"
}

Per the readme, base64d does still seem to be a valid filter.

With jaq 1.4.0:

❯ cargo install --locked jaq@1.4.0
❯ jaq --version
jaq 1.4.0
❯ echo '{"a": "aGVsbG8=", "b": "d29ybGQ="}' | jaq "map_values(@base64d)"
{
  "a": "hello",
  "b": "world"
}
01mf02 commented 1 week ago

Hi @lukehsiao, thanks for spotting this. I forgot to reimplement @base64d in my last refactoring. It should work as of commit 3b89a88.

lukehsiao commented 1 week ago

It would be great to get a patch release (e.g., 1.5.1) with the fix if you have the time :). In the meantime I'll move back to 1.4.0.

01mf02 commented 1 week ago

@lukehsiao, 1.5.1 is out now. :) Have fun with it, and thanks again for spotting this issue!