feat(jsontools): add tools to pretty print json-lines (ndjson) (#10176)

Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
Eduardo FloresandMarc Cornellà authored and Marc Cornellà committed 2021-09-22 09:19:11 +02:00
1 parent b590939637
commit 7ded6752fd
2 files changed
+48 -9

No files matched your search

+9 -1
View File
@@ -101,5 +101,13 @@ print(unquote_plus(sys.stdin.read()))
}
;;
esac
unset JSONTOOLS_METHOD
## Add NDJSON support
function {pp,is,urlencode,urldecode}_ndjson() {
local json jsonfunc="${0//ndjson/json}"
while read -r json; do
$jsonfunc <<< "$json"
done
}