mirror of
https://github.com/wader/fq.git
synced 2024-12-24 22:05:31 +03:00
14 lines
336 B
Plaintext
14 lines
336 B
Plaintext
|
def _cbor_torepr:
|
||
|
def _f:
|
||
|
( if .major_type == "map" then
|
||
|
( .pairs
|
||
|
| map({key: (.key | _f), value: (.value | _f)})
|
||
|
| from_entries
|
||
|
)
|
||
|
elif .major_type == "array" then .elements | map(_f)
|
||
|
elif .major_type == "bytes" then .value | tostring
|
||
|
else .value | tovalue
|
||
|
end
|
||
|
);
|
||
|
_f;
|