borkdude / jet

CLI to transform between JSON, EDN, YAML and Transit using Clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--keywordize fn not called when input is yaml

evanlouie opened this issue · comments

-k/--keywordize flag doesn't make use of key-fn when the input is YAML:

echo "foo_bar: baz" | jet -i yaml -k '#(keyword (str/replace % "_" "-"))'
{:foo_bar "baz"}

If I convert to JSON first, it works:

echo "foo_bar: baz" | jet -i yaml -o json | jet -i json -k '#(keyword (str/replace % "_" "-"))' 
{:foo-bar "baz"}

Jet version:

jet --version
0.5.25

PR welcome. Not sure if clj-yaml supports a key-fn but if it does, it should not be that hard probably.