mirror of
https://github.com/wader/fq.git
synced 2024-11-23 00:57:15 +03:00
87b2c6c10c
Markdown is used as is in online documentation and in cli the markdown decoder is used to decode and the some jq code massages it into something cli friendly. Was just too much of a mess to have doc in jq.
11 lines
308 B
Plaintext
11 lines
308 B
Plaintext
def _cbor_torepr:
|
|
if .major_type == "map" then
|
|
( .pairs
|
|
| map({key: (.key | _cbor_torepr), value: (.value | _cbor_torepr)})
|
|
| from_entries
|
|
)
|
|
elif .major_type == "array" then .elements | map(_cbor_torepr)
|
|
elif .major_type == "bytes" then .value | tostring
|
|
else .value | tovalue
|
|
end;
|