mirror of
https://github.com/wader/fq.git
synced 2024-12-23 13:22:58 +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.
20 lines
382 B
Plaintext
20 lines
382 B
Plaintext
def _bson_torepr:
|
|
def _f:
|
|
( if .type == null or .type == "array" then
|
|
( .value.elements
|
|
| map(_f)
|
|
)
|
|
elif .type == "document" then
|
|
( .value.elements
|
|
| map({key: .name, value: _f})
|
|
| from_entries
|
|
)
|
|
elif .type == "boolean" then .value != 0
|
|
else .value | tovalue
|
|
end
|
|
);
|
|
( {type: "document", value: .}
|
|
| _f
|
|
);
|
|
|