Created
December 3, 2019 10:09
-
-
Save eqyiel/3c9c4ea5254e2059881a0cbcb8700392 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jq --raw-output --from-file --stream | |
. as $in | |
| select(length > 1) | |
| ( | |
.[0] | map( | |
if type == "number" | |
then "[" + @json + "]" | |
else "." + . | |
end | |
) | join("") | |
) | |
+ " = " | |
+ (.[1] | @json) | |
# https://news.ycombinator.com/item?id=20246957 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment