@port-labs/jq-node-bindings 0.0.13 → 0.0.15-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/binding.gyp +41 -19
- package/configure +1 -1
- package/deps/jq/.gitattributes +12 -0
- package/deps/jq/AUTHORS +149 -43
- package/deps/jq/COPYING +75 -1
- package/deps/jq/ChangeLog +2 -2
- package/deps/jq/Makefile.am +106 -65
- package/deps/jq/NEWS.md +391 -0
- package/deps/jq/README.md +54 -52
- package/deps/jq/SECURITY.md +7 -0
- package/deps/jq/compile-ios.sh +106 -102
- package/deps/jq/configure.ac +72 -59
- package/deps/jq/docs/Pipfile +14 -0
- package/deps/jq/docs/Pipfile.lock +415 -0
- package/deps/jq/docs/README.md +15 -14
- package/deps/jq/docs/build_manpage.py +251 -0
- package/deps/jq/docs/build_mantests.py +21 -0
- package/deps/jq/docs/build_website.py +95 -0
- package/deps/jq/docs/content/download/default.yml +249 -0
- package/deps/jq/docs/content/index.yml +83 -0
- package/deps/jq/docs/content/{3.manual/v1.6 → manual/dev}/manual.yml +992 -452
- package/deps/jq/docs/content/{3.manual → manual}/v1.3/manual.yml +105 -116
- package/deps/jq/docs/content/{3.manual → manual}/v1.4/manual.yml +122 -129
- package/deps/jq/docs/content/{3.manual → manual}/v1.5/manual.yml +313 -262
- package/deps/jq/docs/content/{3.manual → manual/v1.6}/manual.yml +407 -332
- package/deps/jq/docs/content/manual/v1.7/manual.yml +3697 -0
- package/deps/jq/docs/content/tutorial/default.yml +337 -0
- package/deps/jq/docs/manual_schema.yml +60 -0
- package/deps/jq/docs/public/css/style.css +99 -0
- package/deps/jq/docs/public/icon.png +0 -0
- package/deps/jq/docs/public/icon.svg +1 -0
- package/deps/jq/docs/public/jq.svg +1 -0
- package/deps/jq/docs/public/js/manual-search.js +31 -49
- package/deps/jq/docs/templates/default.html.j2 +31 -0
- package/deps/jq/docs/templates/index.html.j2 +58 -0
- package/deps/jq/docs/templates/manual.html.j2 +120 -0
- package/deps/jq/docs/templates/shared/_footer.html.j2 +14 -0
- package/deps/jq/docs/templates/shared/_head.html.j2 +23 -0
- package/deps/jq/docs/templates/shared/_navbar.html.j2 +40 -0
- package/deps/jq/docs/validate_manual_schema.py +19 -0
- package/deps/jq/jq.1.prebuilt +1102 -294
- package/deps/jq/jq.spec +2 -3
- package/deps/jq/libjq.pc.in +11 -0
- package/deps/jq/m4/ax_pthread.m4 +522 -0
- package/deps/jq/modules/oniguruma/.travis.yml +17 -0
- package/deps/jq/modules/oniguruma/CMakeLists.txt +206 -41
- package/deps/jq/modules/oniguruma/COPYING +23 -25
- package/deps/jq/modules/oniguruma/HISTORY +368 -23
- package/deps/jq/modules/oniguruma/Makefile.am +61 -7
- package/deps/jq/modules/oniguruma/README +34 -20
- package/deps/jq/modules/oniguruma/README.md +106 -33
- package/deps/jq/modules/oniguruma/README_japanese +183 -0
- package/deps/jq/modules/oniguruma/autogen.sh +9 -0
- package/deps/jq/modules/oniguruma/cmake/Config.cmake.in +4 -0
- package/deps/jq/modules/oniguruma/configure.ac +66 -55
- package/deps/jq/modules/oniguruma/doc/API +485 -42
- package/deps/jq/modules/oniguruma/doc/API.ja +732 -293
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API +397 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.API.ja +393 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN +95 -0
- package/deps/jq/modules/oniguruma/doc/CALLOUTS.BUILTIN.ja +93 -0
- package/deps/jq/modules/oniguruma/doc/FAQ +3 -3
- package/deps/jq/modules/oniguruma/doc/FAQ.ja +8 -8
- package/deps/jq/modules/oniguruma/doc/RE +223 -63
- package/deps/jq/modules/oniguruma/doc/RE.ja +420 -265
- package/deps/jq/modules/oniguruma/doc/SYNTAX.md +1091 -0
- package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +840 -697
- package/deps/jq/modules/oniguruma/harnesses/ascii_compatible.dict +113 -0
- package/deps/jq/modules/oniguruma/harnesses/base.c +749 -0
- package/deps/jq/modules/oniguruma/harnesses/deluxe.c +206 -0
- package/deps/jq/modules/oniguruma/harnesses/dict_conv.py +72 -0
- package/deps/jq/modules/oniguruma/harnesses/fuzzer.options +2 -0
- package/deps/jq/modules/oniguruma/harnesses/libfuzzer-onig.cpp +45 -0
- package/deps/jq/modules/oniguruma/harnesses/regset.c +392 -0
- package/deps/jq/modules/oniguruma/index.html +16 -5
- package/deps/jq/modules/oniguruma/index_ja.html +16 -5
- package/deps/jq/modules/oniguruma/make_win.bat +5 -0
- package/deps/jq/modules/oniguruma/make_win32.bat +5 -3
- package/deps/jq/modules/oniguruma/make_win64.bat +5 -3
- package/deps/jq/modules/oniguruma/onig-config.cmake.in +80 -0
- package/deps/jq/modules/oniguruma/onig-config.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +1 -1
- package/deps/jq/modules/oniguruma/oniguruma.pc.in +0 -1
- package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +9 -2
- package/deps/jq/modules/oniguruma/sample/Makefile.am +24 -5
- package/deps/jq/modules/oniguruma/sample/bug_fix.c +13 -51
- package/deps/jq/modules/oniguruma/sample/callback_each_match.c +168 -0
- package/deps/jq/modules/oniguruma/sample/callout.c +268 -0
- package/deps/jq/modules/oniguruma/sample/count.c +125 -0
- package/deps/jq/modules/oniguruma/sample/crnl.c +6 -4
- package/deps/jq/modules/oniguruma/sample/echo.c +136 -0
- package/deps/jq/modules/oniguruma/sample/encode.c +53 -146
- package/deps/jq/modules/oniguruma/sample/listcap.c +18 -10
- package/deps/jq/modules/oniguruma/sample/names.c +10 -6
- package/deps/jq/modules/oniguruma/sample/posix.c +13 -2
- package/deps/jq/modules/oniguruma/sample/regset.c +95 -0
- package/deps/jq/modules/oniguruma/sample/scan.c +20 -6
- package/deps/jq/modules/oniguruma/sample/simple.c +8 -4
- package/deps/jq/modules/oniguruma/sample/sql.c +13 -8
- package/deps/jq/modules/oniguruma/sample/syntax.c +11 -10
- package/deps/jq/modules/oniguruma/sample/user_property.c +12 -7
- package/deps/jq/modules/oniguruma/src/Makefile.am +41 -15
- package/deps/jq/modules/oniguruma/src/Makefile.windows +196 -183
- package/deps/jq/modules/oniguruma/src/ascii.c +64 -7
- package/deps/jq/modules/oniguruma/src/big5.c +25 -15
- package/deps/jq/modules/oniguruma/src/config.h.cmake.in +7 -22
- package/deps/jq/modules/oniguruma/src/config.h.win32 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.win64 +56 -84
- package/deps/jq/modules/oniguruma/src/config.h.windows.in +62 -0
- package/deps/jq/modules/oniguruma/src/cp1251.c +14 -8
- package/deps/jq/modules/oniguruma/src/euc_jp.c +28 -30
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/euc_kr.c +27 -15
- package/deps/jq/modules/oniguruma/src/euc_tw.c +40 -17
- package/deps/jq/modules/oniguruma/src/gb18030.c +177 -119
- package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +12 -8
- package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +8 -6
- package/deps/jq/modules/oniguruma/src/iso8859_1.c +92 -91
- package/deps/jq/modules/oniguruma/src/iso8859_10.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_11.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_13.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_14.c +13 -30
- package/deps/jq/modules/oniguruma/src/iso8859_15.c +13 -34
- package/deps/jq/modules/oniguruma/src/iso8859_16.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_2.c +13 -29
- package/deps/jq/modules/oniguruma/src/iso8859_3.c +13 -33
- package/deps/jq/modules/oniguruma/src/iso8859_4.c +13 -32
- package/deps/jq/modules/oniguruma/src/iso8859_5.c +16 -23
- package/deps/jq/modules/oniguruma/src/iso8859_6.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_7.c +14 -29
- package/deps/jq/modules/oniguruma/src/iso8859_8.c +4 -2
- package/deps/jq/modules/oniguruma/src/iso8859_9.c +13 -33
- package/deps/jq/modules/oniguruma/src/koi8.c +14 -27
- package/deps/jq/modules/oniguruma/src/koi8_r.c +12 -19
- package/deps/jq/modules/oniguruma/src/make_property.sh +21 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +25 -11
- package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +206 -26
- package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +19 -10
- package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +474 -375
- package/deps/jq/modules/oniguruma/src/make_unicode_wb.sh +7 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_wb_data.py +267 -0
- package/deps/jq/modules/oniguruma/src/mktable.c +28 -24
- package/deps/jq/modules/oniguruma/src/onig_init.c +2 -2
- package/deps/jq/modules/oniguruma/src/oniggnu.h +7 -5
- package/deps/jq/modules/oniguruma/src/onigposix.h +40 -16
- package/deps/jq/modules/oniguruma/src/oniguruma.h +357 -107
- package/deps/jq/modules/oniguruma/src/regcomp.c +6214 -3933
- package/deps/jq/modules/oniguruma/src/regenc.c +197 -120
- package/deps/jq/modules/oniguruma/src/regenc.h +106 -63
- package/deps/jq/modules/oniguruma/src/regerror.c +112 -91
- package/deps/jq/modules/oniguruma/src/regexec.c +4876 -2010
- package/deps/jq/modules/oniguruma/src/regext.c +8 -8
- package/deps/jq/modules/oniguruma/src/reggnu.c +13 -17
- package/deps/jq/modules/oniguruma/src/regint.h +757 -491
- package/deps/jq/modules/oniguruma/src/regparse.c +7204 -3240
- package/deps/jq/modules/oniguruma/src/regparse.h +361 -218
- package/deps/jq/modules/oniguruma/src/regposerr.c +49 -9
- package/deps/jq/modules/oniguruma/src/regposix.c +106 -24
- package/deps/jq/modules/oniguruma/src/regsyntax.c +66 -13
- package/deps/jq/modules/oniguruma/src/regtrav.c +1 -1
- package/deps/jq/modules/oniguruma/src/regversion.c +6 -4
- package/deps/jq/modules/oniguruma/src/sjis.c +23 -52
- package/deps/jq/modules/oniguruma/src/sjis_prop.c +25 -32
- package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +1 -2
- package/deps/jq/modules/oniguruma/src/st.c +248 -249
- package/deps/jq/modules/oniguruma/src/st.h +4 -5
- package/deps/jq/modules/oniguruma/src/unicode.c +869 -294
- package/deps/jq/modules/oniguruma/src/unicode_egcb_data.c +1419 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +1829 -1300
- package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +32 -9
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1210 -984
- package/deps/jq/modules/oniguruma/src/unicode_property_data.c +22480 -15198
- package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +1463 -591
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +1958 -1418
- package/deps/jq/modules/oniguruma/src/unicode_wb_data.c +1106 -0
- package/deps/jq/modules/oniguruma/src/utf16_be.c +90 -49
- package/deps/jq/modules/oniguruma/src/utf16_le.c +80 -49
- package/deps/jq/modules/oniguruma/src/utf32_be.c +14 -42
- package/deps/jq/modules/oniguruma/src/utf32_le.c +13 -40
- package/deps/jq/modules/oniguruma/src/utf8.c +33 -78
- package/deps/jq/modules/oniguruma/test/CMakeLists.txt +55 -0
- package/deps/jq/modules/oniguruma/test/Makefile.am +65 -10
- package/deps/jq/modules/oniguruma/test/test.sh +17 -0
- package/deps/jq/modules/oniguruma/test/test_back.c +1450 -0
- package/deps/jq/modules/oniguruma/test/test_options.c +228 -0
- package/deps/jq/modules/oniguruma/test/test_regset.c +466 -0
- package/deps/jq/modules/oniguruma/test/test_syntax.c +365 -0
- package/deps/jq/modules/oniguruma/test/test_utf8.c +1761 -0
- package/deps/jq/modules/oniguruma/test/testc.c +128 -88
- package/deps/jq/modules/oniguruma/test/testp.c +613 -0
- package/deps/jq/modules/oniguruma/test/testu.c +75 -28
- package/deps/jq/modules/oniguruma/tis-ci/stub.c +3 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_back.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_regset.config +20 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_syntax.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/test_utf8.config +25 -0
- package/deps/jq/modules/oniguruma/tis-ci/testc.config +26 -0
- package/deps/jq/modules/oniguruma/tis-ci/testu.config +24 -0
- package/deps/jq/modules/oniguruma/tis.config +1336 -0
- package/deps/jq/modules/oniguruma/windows/CMakeLists.txt +8 -0
- package/deps/jq/modules/oniguruma/windows/testc.c +865 -869
- package/deps/jq/scripts/update-website +6 -5
- package/deps/jq/scripts/version +10 -7
- package/deps/jq/sig/jq-release-new.key +29 -0
- package/deps/jq/sig/v1.4/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.5rc1/sha256sum.txt +1 -0
- package/deps/jq/sig/v1.5rc2/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.6/sha256sum.txt +2 -0
- package/deps/jq/sig/v1.7/jq-1.7.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7/jq-1.7.zip.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.zip.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7.1/sha256sum.txt +26 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-1.7rc1.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc1/sha256sum.txt +23 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-1.7rc2.zip.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.7rc2/sha256sum.txt +23 -0
- package/deps/jq/src/builtin.c +537 -343
- package/deps/jq/src/builtin.h +18 -0
- package/deps/jq/src/builtin.jq +116 -143
- package/deps/jq/src/bytecode.h +8 -4
- package/deps/jq/src/compile.c +157 -143
- package/deps/jq/src/compile.h +3 -4
- package/deps/jq/src/decNumber/ICU-license.html +45 -0
- package/deps/jq/src/decNumber/decBasic.c +3908 -0
- package/deps/jq/src/decNumber/decCommon.c +1835 -0
- package/deps/jq/src/decNumber/decContext.c +437 -0
- package/deps/jq/src/decNumber/decContext.h +254 -0
- package/deps/jq/src/decNumber/decDPD.h +1185 -0
- package/deps/jq/src/decNumber/decDouble.c +140 -0
- package/deps/jq/src/decNumber/decDouble.h +155 -0
- package/deps/jq/src/decNumber/decNumber.c +8143 -0
- package/deps/jq/src/decNumber/decNumber.h +182 -0
- package/deps/jq/src/decNumber/decNumberLocal.h +757 -0
- package/deps/jq/src/decNumber/decPacked.c +220 -0
- package/deps/jq/src/decNumber/decPacked.h +52 -0
- package/deps/jq/src/decNumber/decQuad.c +135 -0
- package/deps/jq/src/decNumber/decQuad.h +177 -0
- package/deps/jq/src/decNumber/decSingle.c +71 -0
- package/deps/jq/src/decNumber/decSingle.h +86 -0
- package/deps/jq/src/decNumber/decimal128.c +553 -0
- package/deps/jq/src/decNumber/decimal128.h +81 -0
- package/deps/jq/src/decNumber/decimal32.c +476 -0
- package/deps/jq/src/decNumber/decimal32.h +81 -0
- package/deps/jq/src/decNumber/decimal64.c +839 -0
- package/deps/jq/src/decNumber/decimal64.h +83 -0
- package/deps/jq/src/decNumber/decnumber.pdf +0 -0
- package/deps/jq/src/decNumber/example1.c +38 -0
- package/deps/jq/src/decNumber/example2.c +52 -0
- package/deps/jq/src/decNumber/example3.c +64 -0
- package/deps/jq/src/decNumber/example4.c +61 -0
- package/deps/jq/src/decNumber/example5.c +36 -0
- package/deps/jq/src/decNumber/example6.c +61 -0
- package/deps/jq/src/decNumber/example7.c +35 -0
- package/deps/jq/src/decNumber/example8.c +39 -0
- package/deps/jq/src/decNumber/readme.txt +81 -0
- package/deps/jq/src/exec_stack.h +5 -3
- package/deps/jq/src/execute.c +126 -44
- package/deps/jq/src/inject_errors.c +0 -2
- package/deps/jq/src/jq.h +10 -1
- package/deps/jq/src/jq_test.c +222 -11
- package/deps/jq/src/jv.c +807 -176
- package/deps/jq/src/jv.h +22 -1
- package/deps/jq/src/jv_alloc.c +33 -26
- package/deps/jq/src/jv_alloc.h +0 -11
- package/deps/jq/src/jv_aux.c +153 -67
- package/deps/jq/src/jv_dtoa.c +12 -2
- package/deps/jq/src/jv_dtoa_tsd.c +51 -0
- package/deps/jq/src/jv_dtoa_tsd.h +4 -0
- package/deps/jq/src/jv_parse.c +70 -15
- package/deps/jq/src/jv_print.c +56 -60
- package/deps/jq/src/jv_private.h +7 -0
- package/deps/jq/src/jv_thread.h +76 -0
- package/deps/jq/src/jv_unicode.c +18 -0
- package/deps/jq/src/jv_unicode.h +2 -0
- package/deps/jq/src/lexer.c +782 -543
- package/deps/jq/src/lexer.h +438 -64
- package/deps/jq/src/lexer.l +10 -3
- package/deps/jq/src/libm.h +16 -6
- package/deps/jq/src/linker.c +97 -40
- package/deps/jq/src/locfile.c +2 -1
- package/deps/jq/src/main.c +384 -336
- package/deps/jq/src/opcode_list.h +5 -2
- package/deps/jq/src/parser.c +2260 -1898
- package/deps/jq/src/parser.h +115 -98
- package/deps/jq/src/parser.y +124 -89
- package/deps/jq/src/util.c +854 -55
- package/deps/jq/src/util.h +6 -4
- package/deps/jq/tests/jq.test +762 -26
- package/deps/jq/tests/jq_fuzz_compile.c +27 -0
- package/deps/jq/tests/jq_fuzz_execute.cpp +42 -0
- package/deps/jq/tests/jq_fuzz_fixed.cpp +297 -0
- package/deps/jq/tests/jq_fuzz_load_file.c +28 -0
- package/deps/jq/tests/jq_fuzz_parse.c +21 -0
- package/deps/jq/tests/jq_fuzz_parse_extended.c +36 -0
- package/deps/jq/tests/jq_fuzz_parse_stream.c +21 -0
- package/deps/jq/tests/local.supp +14 -0
- package/deps/jq/tests/man.test +979 -0
- package/deps/jq/tests/manonig.test +76 -0
- package/deps/jq/tests/manonigtest +5 -0
- package/deps/jq/tests/mantest +1 -2
- package/deps/jq/tests/modules/home2/.jq/g.jq +1 -0
- package/deps/jq/tests/modules/shadow1.jq +2 -0
- package/deps/jq/tests/modules/shadow2.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
- package/deps/jq/tests/modules/test_bind_order1.jq +1 -1
- package/deps/jq/tests/modules/test_bind_order2.jq +0 -1
- package/deps/jq/tests/no-main-program.jq +1 -0
- package/deps/jq/tests/onig.test +77 -2
- package/deps/jq/tests/setup +7 -2
- package/deps/jq/tests/shtest +478 -59
- package/deps/jq/tests/uri.test +38 -0
- package/deps/jq/tests/uritest +5 -0
- package/deps/jq/tests/yes-main-program.jq +2 -0
- package/lib/index.js +3 -0
- package/lib/jq.js +15 -1
- package/lib/templateAsync.js +137 -0
- package/package.json +7 -7
- package/src/binding.cc +623 -146
- package/src/binding.h +3 -4
- package/test/santiy-async.test.js +171 -0
- package/test/santiy.test.js +2 -2
- package/test/template-async.test.js +182 -0
- package/test/template.test.js +3 -3
- package/deps/jq/.travis.yml +0 -202
- package/deps/jq/NEWS +0 -89
- package/deps/jq/appveyor.yml +0 -53
- package/deps/jq/docs/Gemfile +0 -7
- package/deps/jq/docs/Gemfile.lock +0 -63
- package/deps/jq/docs/Rakefile +0 -24
- package/deps/jq/docs/Rakefile.manual +0 -49
- package/deps/jq/docs/Rakefile.website +0 -76
- package/deps/jq/docs/content/1.tutorial/default.yml +0 -327
- package/deps/jq/docs/content/2.download/default.yml +0 -193
- package/deps/jq/docs/content/index/index.yml +0 -73
- package/deps/jq/docs/public/css/base.scss +0 -181
- package/deps/jq/docs/public/jq.png +0 -0
- package/deps/jq/docs/site.yml +0 -9
- package/deps/jq/docs/templates/default.liquid +0 -34
- package/deps/jq/docs/templates/index.liquid +0 -73
- package/deps/jq/docs/templates/manual.liquid +0 -99
- package/deps/jq/docs/templates/shared/_footer.liquid +0 -10
- package/deps/jq/docs/templates/shared/_head.liquid +0 -17
- package/deps/jq/docs/templates/shared/_navbar.liquid +0 -27
- package/deps/jq/modules/oniguruma/README.ja +0 -195
- package/deps/jq/modules/oniguruma/cmake/dist.cmake +0 -321
- package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +0 -31
- package/deps/jq/modules/oniguruma/dist.info +0 -10
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +0 -2250
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +0 -203
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +0 -113
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +0 -1225
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +0 -24742
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +0 -4846
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +0 -2571
- /package/deps/jq/sig/{jq-release.key → jq-release-old.key} +0 -0
- /package/deps/jq/tests/modules/{.jq → home1/.jq} +0 -0
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
headline: jq 1.3 Manual
|
|
3
3
|
|
|
4
|
-
history: |
|
|
5
|
-
|
|
6
|
-
*The manual for the development version of jq can be found
|
|
7
|
-
[here](/jq/manual).*
|
|
8
|
-
|
|
9
4
|
body: |
|
|
10
5
|
|
|
11
6
|
A jq program is a "filter": it takes an input, and produces an
|
|
@@ -63,7 +58,7 @@ manpage_epilogue: |
|
|
|
63
58
|
|
|
64
59
|
Presumably. Report them or discuss them at:
|
|
65
60
|
|
|
66
|
-
https://github.com/
|
|
61
|
+
https://github.com/jqlang/jq/issues
|
|
67
62
|
|
|
68
63
|
## AUTHOR
|
|
69
64
|
|
|
@@ -76,30 +71,30 @@ sections:
|
|
|
76
71
|
jq filters run on a stream of JSON data. The input to jq is
|
|
77
72
|
parsed as a sequence of whitespace-separated JSON values which
|
|
78
73
|
are passed through the provided filter one at a time. The
|
|
79
|
-
output(s) of the filter are written to standard
|
|
80
|
-
sequence of
|
|
74
|
+
output(s) of the filter are written to standard output, as a
|
|
75
|
+
sequence of newline-separated JSON data.
|
|
81
76
|
|
|
82
77
|
You can affect how jq reads and writes its input and output
|
|
83
78
|
using some command-line options:
|
|
84
79
|
|
|
85
|
-
* `--
|
|
80
|
+
* `--null-input` / `-n`:
|
|
86
81
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
Don't read any input at all. Instead, the filter is run once
|
|
83
|
+
using `null` as the input. This is useful when using jq as a
|
|
84
|
+
simple calculator or to construct JSON data from scratch.
|
|
90
85
|
|
|
91
|
-
* `--raw-input
|
|
86
|
+
* `--raw-input` / `-R`:
|
|
92
87
|
|
|
93
88
|
Don't parse the input as JSON. Instead, each line of text is
|
|
94
89
|
passed to the filter as a string. If combined with `--slurp`,
|
|
95
90
|
then the entire input is passed to the filter as a single long
|
|
96
91
|
string.
|
|
97
92
|
|
|
98
|
-
* `--
|
|
93
|
+
* `--slurp` / `-s`:
|
|
99
94
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
Instead of running the filter for each JSON object in the
|
|
96
|
+
input, read the entire input stream into a large array and run
|
|
97
|
+
the filter just once.
|
|
103
98
|
|
|
104
99
|
* `--compact-output` / `-c`:
|
|
105
100
|
|
|
@@ -107,11 +102,12 @@ sections:
|
|
|
107
102
|
will result in more compact output by instead putting each
|
|
108
103
|
JSON object on a single line.
|
|
109
104
|
|
|
110
|
-
* `--
|
|
105
|
+
* `--raw-output` / `-r`:
|
|
111
106
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
With this option, if the filter's result is a string then it
|
|
108
|
+
will be written directly to standard output rather than being
|
|
109
|
+
formatted as a JSON string with quotes. This can be useful for
|
|
110
|
+
making jq filters talk to non-JSON-based systems.
|
|
115
111
|
|
|
116
112
|
* `--ascii-output` / `-a`:
|
|
117
113
|
|
|
@@ -121,12 +117,11 @@ sections:
|
|
|
121
117
|
ASCII output with every non-ASCII character replaced with the
|
|
122
118
|
equivalent escape sequence.
|
|
123
119
|
|
|
124
|
-
* `--
|
|
120
|
+
* `--color-output` / `-C` and `--monochrome-output` / `-M`:
|
|
125
121
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
making jq filters talk to non-JSON-based systems.
|
|
122
|
+
By default, jq outputs colored JSON if writing to a
|
|
123
|
+
terminal. You can force it to produce color even if writing to
|
|
124
|
+
a pipe or a file using `-C`, and disable color with `-M`.
|
|
130
125
|
|
|
131
126
|
* `--arg name value`:
|
|
132
127
|
|
|
@@ -162,7 +157,7 @@ sections:
|
|
|
162
157
|
examples:
|
|
163
158
|
- program: '.foo'
|
|
164
159
|
input: '{"foo": 42, "bar": "less interesting data"}'
|
|
165
|
-
output: [42]
|
|
160
|
+
output: ['42']
|
|
166
161
|
- program: '.foo'
|
|
167
162
|
input: '{"notfoo": true, "alsonotfoo": false}'
|
|
168
163
|
output: ['null']
|
|
@@ -171,10 +166,9 @@ sections:
|
|
|
171
166
|
body: |
|
|
172
167
|
|
|
173
168
|
You can also look up fields of an object using syntax like
|
|
174
|
-
`.["foo"]` (
|
|
175
|
-
one works for arrays as well, if the key is an
|
|
176
|
-
|
|
177
|
-
returns the third element of the array.
|
|
169
|
+
`.["foo"]` (`.foo` above is a shorthand version of this). This
|
|
170
|
+
one works for arrays as well, if the key is an integer. Arrays
|
|
171
|
+
are zero-based, so `.[2]` returns the third element of the array.
|
|
178
172
|
|
|
179
173
|
The `.[10:15]` syntax can be used to return a subarray of an
|
|
180
174
|
array. The array returned by `.[10:15]` will be of length 5,
|
|
@@ -279,13 +273,13 @@ sections:
|
|
|
279
273
|
hashes with only string keys), and "null".
|
|
280
274
|
|
|
281
275
|
Booleans, null, strings and numbers are written the same way as
|
|
282
|
-
in
|
|
276
|
+
in JSON. Just like everything else in jq, these simple
|
|
283
277
|
values take an input and produce an output - `42` is a valid jq
|
|
284
278
|
expression that takes an input, ignores it, and returns 42
|
|
285
279
|
instead.
|
|
286
280
|
|
|
287
281
|
entries:
|
|
288
|
-
- title: Array construction
|
|
282
|
+
- title: "Array construction: `[]`"
|
|
289
283
|
body: |
|
|
290
284
|
|
|
291
285
|
As in JSON, `[]` is used to construct arrays, as in
|
|
@@ -310,7 +304,7 @@ sections:
|
|
|
310
304
|
- program: "[.user, .projects[]]"
|
|
311
305
|
input: '{"user":"stedolan", "projects": ["jq", "wikiflow"]}'
|
|
312
306
|
output: ['["stedolan", "jq", "wikiflow"]']
|
|
313
|
-
- title: Objects
|
|
307
|
+
- title: "Objects: `{}`"
|
|
314
308
|
body: |
|
|
315
309
|
|
|
316
310
|
Like JSON, `{}` is for constructing objects (aka
|
|
@@ -371,14 +365,14 @@ sections:
|
|
|
371
365
|
- title: Builtin operators and functions
|
|
372
366
|
body: |
|
|
373
367
|
|
|
374
|
-
Some jq
|
|
368
|
+
Some jq operators (for instance, `+`) do different things
|
|
375
369
|
depending on the type of their arguments (arrays, numbers,
|
|
376
370
|
etc.). However, jq never does implicit type conversions. If you
|
|
377
371
|
try to add a string to an object you'll get an error message and
|
|
378
372
|
no result.
|
|
379
373
|
|
|
380
374
|
entries:
|
|
381
|
-
- title: Addition
|
|
375
|
+
- title: "Addition: `+`"
|
|
382
376
|
body: |
|
|
383
377
|
|
|
384
378
|
The operator `+` takes two filters, applies them both
|
|
@@ -416,11 +410,11 @@ sections:
|
|
|
416
410
|
input: 'null'
|
|
417
411
|
output: ['{"a": 42, "b": 2, "c": 3}']
|
|
418
412
|
|
|
419
|
-
- title: Subtraction
|
|
413
|
+
- title: "Subtraction: `-`"
|
|
420
414
|
body: |
|
|
421
415
|
|
|
422
416
|
As well as normal arithmetic subtraction on numbers, the `-`
|
|
423
|
-
operator can be used on arrays to remove all
|
|
417
|
+
operator can be used on arrays to remove all occurrences of
|
|
424
418
|
the second array's elements from the first array.
|
|
425
419
|
|
|
426
420
|
examples:
|
|
@@ -431,17 +425,17 @@ sections:
|
|
|
431
425
|
input: '["xml", "yaml", "json"]'
|
|
432
426
|
output: ['["json"]']
|
|
433
427
|
|
|
434
|
-
- title: Multiplication, division
|
|
428
|
+
- title: "Multiplication, division: `*` and `/`"
|
|
435
429
|
body: |
|
|
436
430
|
|
|
437
431
|
These operators only work on numbers, and do the expected.
|
|
438
432
|
|
|
439
433
|
examples:
|
|
440
434
|
- program: '10 / . * 3'
|
|
441
|
-
input: 5
|
|
442
|
-
output: [6]
|
|
435
|
+
input: '5'
|
|
436
|
+
output: ['6']
|
|
443
437
|
|
|
444
|
-
- title: `length`
|
|
438
|
+
- title: '`length`'
|
|
445
439
|
body: |
|
|
446
440
|
|
|
447
441
|
The builtin function `length` gets the length of various
|
|
@@ -460,9 +454,9 @@ sections:
|
|
|
460
454
|
examples:
|
|
461
455
|
- program: '.[] | length'
|
|
462
456
|
input: '[[1,2], "string", {"a":2}, null]'
|
|
463
|
-
output: [2, 6, 1, 0]
|
|
457
|
+
output: ['2', '6', '1', '0']
|
|
464
458
|
|
|
465
|
-
- title: `keys`
|
|
459
|
+
- title: '`keys`'
|
|
466
460
|
body: |
|
|
467
461
|
|
|
468
462
|
The builtin function `keys`, when given an object, returns
|
|
@@ -485,7 +479,7 @@ sections:
|
|
|
485
479
|
input: '[42,3,35]'
|
|
486
480
|
output: ['[0,1,2]']
|
|
487
481
|
|
|
488
|
-
- title: `has`
|
|
482
|
+
- title: '`has`'
|
|
489
483
|
body: |
|
|
490
484
|
|
|
491
485
|
The builtin function `has` returns whether the input object
|
|
@@ -504,7 +498,7 @@ sections:
|
|
|
504
498
|
input: '[[0,1], ["a","b","c"]]'
|
|
505
499
|
output: ['[false, true]']
|
|
506
500
|
|
|
507
|
-
- title: `to_entries`, `from_entries`, `with_entries`
|
|
501
|
+
- title: "`to_entries`, `from_entries`, `with_entries(f)`"
|
|
508
502
|
body: |
|
|
509
503
|
|
|
510
504
|
These functions convert between an object and an array of
|
|
@@ -513,9 +507,9 @@ sections:
|
|
|
513
507
|
includes `{"key": k, "value": v}`.
|
|
514
508
|
|
|
515
509
|
`from_entries` does the opposite conversion, and
|
|
516
|
-
`with_entries(
|
|
517
|
-
|
|
518
|
-
|
|
510
|
+
`with_entries(f)` is a shorthand for `to_entries | map(f) |
|
|
511
|
+
from_entries`, useful for doing some operation to all keys
|
|
512
|
+
and values of an object.
|
|
519
513
|
|
|
520
514
|
examples:
|
|
521
515
|
- program: 'to_entries'
|
|
@@ -529,14 +523,14 @@ sections:
|
|
|
529
523
|
output: ['{"KEY_a": 1, "KEY_b": 2}']
|
|
530
524
|
|
|
531
525
|
|
|
532
|
-
- title: `select`
|
|
526
|
+
- title: '`select`'
|
|
533
527
|
body: |
|
|
534
528
|
|
|
535
529
|
The function `select(foo)` produces its input unchanged if
|
|
536
530
|
`foo` returns true for that input, and produces no output
|
|
537
531
|
otherwise.
|
|
538
532
|
|
|
539
|
-
It's useful for filtering lists: `[1,2,3] | map(select(. >= 2))`
|
|
533
|
+
It's useful for filtering lists: '`[1,2,3] | map(select(. >= 2))`'
|
|
540
534
|
will give you `[3]`.
|
|
541
535
|
|
|
542
536
|
examples:
|
|
@@ -544,7 +538,7 @@ sections:
|
|
|
544
538
|
input: '[1,5,3,0,7]'
|
|
545
539
|
output: ['[5,3,7]']
|
|
546
540
|
|
|
547
|
-
- title: `empty`
|
|
541
|
+
- title: '`empty`'
|
|
548
542
|
body: |
|
|
549
543
|
|
|
550
544
|
`empty` returns no results. None at all. Not even `null`.
|
|
@@ -554,19 +548,19 @@ sections:
|
|
|
554
548
|
examples:
|
|
555
549
|
- program: '1, empty, 2'
|
|
556
550
|
input: 'null'
|
|
557
|
-
output: [1, 2]
|
|
551
|
+
output: ['1', '2']
|
|
558
552
|
- program: '[1,2,empty,3]'
|
|
559
553
|
input: 'null'
|
|
560
554
|
output: ['[1,2,3]']
|
|
561
555
|
|
|
562
|
-
- title: `map(
|
|
556
|
+
- title: '`map(f)`'
|
|
563
557
|
body: |
|
|
564
558
|
|
|
565
|
-
For any filter `
|
|
559
|
+
For any filter `f`, `map(f)` will run that filter for each
|
|
566
560
|
element of the input array, and produce the outputs a new
|
|
567
561
|
array. `map(.+1)` will increment each element of an array of numbers.
|
|
568
562
|
|
|
569
|
-
`map(
|
|
563
|
+
`map(f)` is equivalent to `[.[] | f]`. In fact, this is how
|
|
570
564
|
it's defined.
|
|
571
565
|
|
|
572
566
|
examples:
|
|
@@ -574,7 +568,7 @@ sections:
|
|
|
574
568
|
input: '[1,2,3]'
|
|
575
569
|
output: ['[2,3,4]']
|
|
576
570
|
|
|
577
|
-
- title: `add`
|
|
571
|
+
- title: '`add`'
|
|
578
572
|
body: |
|
|
579
573
|
|
|
580
574
|
The filter `add` takes as input an array, and produces as
|
|
@@ -591,12 +585,12 @@ sections:
|
|
|
591
585
|
output: ['"abc"']
|
|
592
586
|
- program: add
|
|
593
587
|
input: '[1, 2, 3]'
|
|
594
|
-
output: [6]
|
|
588
|
+
output: ['6']
|
|
595
589
|
- program: add
|
|
596
590
|
input: '[]'
|
|
597
591
|
output: ["null"]
|
|
598
592
|
|
|
599
|
-
- title: `range`
|
|
593
|
+
- title: '`range`'
|
|
600
594
|
body: |
|
|
601
595
|
|
|
602
596
|
The `range` function produces a range of numbers. `range(4;10)`
|
|
@@ -612,7 +606,7 @@ sections:
|
|
|
612
606
|
input: 'null'
|
|
613
607
|
output: ['[2,3]']
|
|
614
608
|
|
|
615
|
-
- title: `tonumber`
|
|
609
|
+
- title: '`tonumber`'
|
|
616
610
|
body: |
|
|
617
611
|
|
|
618
612
|
The `tonumber` function parses its input as a number. It
|
|
@@ -622,9 +616,9 @@ sections:
|
|
|
622
616
|
examples:
|
|
623
617
|
- program: '.[] | tonumber'
|
|
624
618
|
input: '[1, "1"]'
|
|
625
|
-
output: [1, 1]
|
|
619
|
+
output: ['1', '1']
|
|
626
620
|
|
|
627
|
-
- title: `tostring`
|
|
621
|
+
- title: '`tostring`'
|
|
628
622
|
body: |
|
|
629
623
|
|
|
630
624
|
The `tostring` function prints its input as a
|
|
@@ -636,7 +630,7 @@ sections:
|
|
|
636
630
|
input: '[1, "1", [1]]'
|
|
637
631
|
output: ['"1"', '"1"', '"[1]"']
|
|
638
632
|
|
|
639
|
-
- title: `type`
|
|
633
|
+
- title: '`type`'
|
|
640
634
|
body: |
|
|
641
635
|
|
|
642
636
|
The `type` function returns the type of its argument as a
|
|
@@ -648,7 +642,7 @@ sections:
|
|
|
648
642
|
input: '[0, false, [], {}, null, "hello"]'
|
|
649
643
|
output: ['["number", "boolean", "array", "object", "null", "string"]']
|
|
650
644
|
|
|
651
|
-
- title: `sort
|
|
645
|
+
- title: '`sort`, `sort_by`'
|
|
652
646
|
body: |
|
|
653
647
|
|
|
654
648
|
The `sort` functions sorts its input, which must be an
|
|
@@ -680,7 +674,7 @@ sections:
|
|
|
680
674
|
input: '[{"foo":4, "bar":10}, {"foo":3, "bar":100}, {"foo":2, "bar":1}]'
|
|
681
675
|
output: ['[{"foo":2, "bar":1}, {"foo":3, "bar":100}, {"foo":4, "bar":10}]']
|
|
682
676
|
|
|
683
|
-
- title: `group_by`
|
|
677
|
+
- title: '`group_by`'
|
|
684
678
|
body: |
|
|
685
679
|
|
|
686
680
|
`group_by(.foo)` takes as input an array, groups the
|
|
@@ -697,7 +691,7 @@ sections:
|
|
|
697
691
|
input: '[{"foo":1, "bar":10}, {"foo":3, "bar":100}, {"foo":1, "bar":1}]'
|
|
698
692
|
output: ['[[{"foo":1, "bar":10}, {"foo":1, "bar":1}], [{"foo":3, "bar":100}]]']
|
|
699
693
|
|
|
700
|
-
- title: `min`, `max`, `min_by`, `max_by`
|
|
694
|
+
- title: '`min`, `max`, `min_by`, `max_by`'
|
|
701
695
|
body: |
|
|
702
696
|
|
|
703
697
|
Find the minimum or maximum element of the input array. The
|
|
@@ -713,7 +707,7 @@ sections:
|
|
|
713
707
|
input: '[{"foo":1, "bar":14}, {"foo":2, "bar":3}]'
|
|
714
708
|
output: ['{"foo":2, "bar":3}']
|
|
715
709
|
|
|
716
|
-
- title: `unique`
|
|
710
|
+
- title: '`unique`'
|
|
717
711
|
body: |
|
|
718
712
|
|
|
719
713
|
The `unique` function takes as input an array and produces
|
|
@@ -725,7 +719,7 @@ sections:
|
|
|
725
719
|
input: '[1,2,5,3,5,3,1,3]'
|
|
726
720
|
output: ['[1,2,3,5]']
|
|
727
721
|
|
|
728
|
-
- title: `reverse`
|
|
722
|
+
- title: '`reverse`'
|
|
729
723
|
body: |
|
|
730
724
|
|
|
731
725
|
This function reverses an array.
|
|
@@ -735,7 +729,7 @@ sections:
|
|
|
735
729
|
input: '[1,2,3,4]'
|
|
736
730
|
output: ['[4,3,2,1]']
|
|
737
731
|
|
|
738
|
-
- title: `contains`
|
|
732
|
+
- title: '`contains`'
|
|
739
733
|
body: |
|
|
740
734
|
|
|
741
735
|
The filter `contains(b)` will produce true if b is
|
|
@@ -764,7 +758,7 @@ sections:
|
|
|
764
758
|
input: '{"foo": 12, "bar":[1,2,{"barp":12, "blip":13}]}'
|
|
765
759
|
output: ['false']
|
|
766
760
|
|
|
767
|
-
- title: `recurse`
|
|
761
|
+
- title: '`recurse`'
|
|
768
762
|
body: |
|
|
769
763
|
|
|
770
764
|
The `recurse` function allows you to search through a
|
|
@@ -796,7 +790,7 @@ sections:
|
|
|
796
790
|
- '{"foo":[]}'
|
|
797
791
|
|
|
798
792
|
|
|
799
|
-
- title: "String interpolation
|
|
793
|
+
- title: "String interpolation: `\\(exp)`"
|
|
800
794
|
body: |
|
|
801
795
|
|
|
802
796
|
Inside a string, you can put an expression inside parens
|
|
@@ -872,24 +866,20 @@ sections:
|
|
|
872
866
|
input: '"This works if x < y"'
|
|
873
867
|
output: ['"This works if x < y"']
|
|
874
868
|
|
|
875
|
-
# - program: '@html "<span>Anonymous said: \(.)</span>"'
|
|
876
|
-
# input: '"<script>alert(\"lol hax\");</script>"'
|
|
877
|
-
# output: ["<span>Anonymous said: <script>alert("lol hax");</script></span>"]
|
|
878
|
-
|
|
879
869
|
- program: '@sh "echo \(.)"'
|
|
880
870
|
input: "\"O'Hara's Ale\""
|
|
881
871
|
output: ["\"echo 'O'\\\\''Hara'\\\\''s Ale'\""]
|
|
882
872
|
|
|
883
873
|
- title: Conditionals and Comparisons
|
|
884
874
|
entries:
|
|
885
|
-
- title: `==`, `!=`
|
|
875
|
+
- title: '`==`, `!=`'
|
|
886
876
|
body: |
|
|
887
877
|
|
|
888
878
|
The expression 'a == b' will produce 'true' if the result of a and b
|
|
889
879
|
are equal (that is, if they represent equivalent JSON documents) and
|
|
890
880
|
'false' otherwise. In particular, strings are never considered equal
|
|
891
|
-
to numbers. If you're coming from
|
|
892
|
-
|
|
881
|
+
to numbers. If you're coming from JavaScript, jq's == is like
|
|
882
|
+
JavaScript's === - considering values equal only when they have the
|
|
893
883
|
same type as well as the same value.
|
|
894
884
|
|
|
895
885
|
!= is "not equal", and 'a != b' returns the opposite value of 'a == b'
|
|
@@ -898,7 +888,8 @@ sections:
|
|
|
898
888
|
- program: '.[] == 1'
|
|
899
889
|
input: '[1, 1.0, "1", "banana"]'
|
|
900
890
|
output: ['true', 'true', 'false', 'false']
|
|
901
|
-
|
|
891
|
+
|
|
892
|
+
- title: if-then-else-end
|
|
902
893
|
body: |
|
|
903
894
|
|
|
904
895
|
`if A then B else C end` will act the same as `B` if `A`
|
|
@@ -906,11 +897,11 @@ sections:
|
|
|
906
897
|
as `C` otherwise.
|
|
907
898
|
|
|
908
899
|
Checking for false or null is a simpler notion of
|
|
909
|
-
"truthiness" than is found in
|
|
900
|
+
"truthiness" than is found in JavaScript or Python, but it
|
|
910
901
|
means that you'll sometimes have to be more explicit about
|
|
911
902
|
the condition you want: you can't test whether, e.g. a
|
|
912
903
|
string is empty using `if .name then A else B end`, you'll
|
|
913
|
-
need something more like `if (.name |
|
|
904
|
+
need something more like `if (.name | length) > 0 then A else
|
|
914
905
|
B end` instead.
|
|
915
906
|
|
|
916
907
|
If the condition `A` produces multiple results, then `B` is evaluated
|
|
@@ -928,10 +919,10 @@ sections:
|
|
|
928
919
|
else
|
|
929
920
|
"many"
|
|
930
921
|
end
|
|
931
|
-
input: 2
|
|
922
|
+
input: '2'
|
|
932
923
|
output: ['"many"']
|
|
933
924
|
|
|
934
|
-
- title:
|
|
925
|
+
- title: "`>`, `>=`, `<=`, `<`"
|
|
935
926
|
body: |
|
|
936
927
|
|
|
937
928
|
The comparison operators `>`, `>=`, `<=`, `<` return whether
|
|
@@ -943,15 +934,16 @@ sections:
|
|
|
943
934
|
|
|
944
935
|
examples:
|
|
945
936
|
- program: '. < 5'
|
|
946
|
-
input: 2
|
|
937
|
+
input: '2'
|
|
947
938
|
output: ['true']
|
|
948
939
|
|
|
949
|
-
- title: and
|
|
940
|
+
- title: "`and`, `or`, `not`"
|
|
950
941
|
body: |
|
|
951
942
|
|
|
952
|
-
jq supports the normal Boolean operators and
|
|
953
|
-
same standard of truth as if expressions -
|
|
954
|
-
considered "false values", and
|
|
943
|
+
jq supports the normal Boolean operators `and`, `or`, `not`.
|
|
944
|
+
They have the same standard of truth as if expressions -
|
|
945
|
+
`false` and `null` are considered "false values", and
|
|
946
|
+
anything else is a "true value".
|
|
955
947
|
|
|
956
948
|
If an operand of one of these operators produces multiple
|
|
957
949
|
results, the operator itself will produce a result for each input.
|
|
@@ -961,12 +953,12 @@ sections:
|
|
|
961
953
|
rather than with special syntax, as in `.foo and .bar |
|
|
962
954
|
not`.
|
|
963
955
|
|
|
964
|
-
These three only produce the values
|
|
956
|
+
These three only produce the values `true` and `false`, and
|
|
965
957
|
so are only useful for genuine Boolean operations, rather
|
|
966
958
|
than the common Perl/Python/Ruby idiom of
|
|
967
959
|
"value_that_may_be_null or default". If you want to use this
|
|
968
960
|
form of "or", picking between two values rather than
|
|
969
|
-
evaluating a condition, see the
|
|
961
|
+
evaluating a condition, see the `//` operator below.
|
|
970
962
|
|
|
971
963
|
examples:
|
|
972
964
|
- program: '42 and "a string"'
|
|
@@ -975,9 +967,6 @@ sections:
|
|
|
975
967
|
- program: '(true, false) or false'
|
|
976
968
|
input: 'null'
|
|
977
969
|
output: ['true', 'false']
|
|
978
|
-
# - program: '(true, false) and (true, false)'
|
|
979
|
-
# input: 'null'
|
|
980
|
-
# output: ['true', 'false', 'false', 'false']
|
|
981
970
|
- program: '(true, true) and (true, false)'
|
|
982
971
|
input: 'null'
|
|
983
972
|
output: ['true', 'false', 'true', 'false']
|
|
@@ -985,7 +974,7 @@ sections:
|
|
|
985
974
|
input: 'null'
|
|
986
975
|
output: ['[false, true]']
|
|
987
976
|
|
|
988
|
-
- title: Alternative operator
|
|
977
|
+
- title: "Alternative operator: `//`"
|
|
989
978
|
body: |
|
|
990
979
|
|
|
991
980
|
A filter of the form `a // b` produces the same
|
|
@@ -1001,10 +990,10 @@ sections:
|
|
|
1001
990
|
examples:
|
|
1002
991
|
- program: '.foo // 42'
|
|
1003
992
|
input: '{"foo": 19}'
|
|
1004
|
-
output: [19]
|
|
993
|
+
output: ['19']
|
|
1005
994
|
- program: '.foo // 42'
|
|
1006
995
|
input: '{}'
|
|
1007
|
-
output: [42]
|
|
996
|
+
output: ['42']
|
|
1008
997
|
|
|
1009
998
|
- title: Advanced features
|
|
1010
999
|
body: |
|
|
@@ -1020,7 +1009,7 @@ sections:
|
|
|
1020
1009
|
|
|
1021
1010
|
It is also possible to define functions in jq, although this is
|
|
1022
1011
|
is a feature whose biggest use is defining jq's standard library
|
|
1023
|
-
(many jq functions such as `map` and `
|
|
1012
|
+
(many jq functions such as `map` and `select` are in fact written
|
|
1024
1013
|
in jq).
|
|
1025
1014
|
|
|
1026
1015
|
Finally, jq has a `reduce` operation, which is very powerful but a
|
|
@@ -1045,7 +1034,7 @@ sections:
|
|
|
1045
1034
|
produces its sum, and the `length` expression is given the array and
|
|
1046
1035
|
produces its length.
|
|
1047
1036
|
|
|
1048
|
-
So, there's generally a cleaner way to solve most problems in jq
|
|
1037
|
+
So, there's generally a cleaner way to solve most problems in jq than
|
|
1049
1038
|
defining variables. Still, sometimes they do make things easier, so jq
|
|
1050
1039
|
lets you define variables using `expression as $variable`. All
|
|
1051
1040
|
variable names start with `$`. Here's a slightly uglier version of the
|
|
@@ -1061,7 +1050,7 @@ sections:
|
|
|
1061
1050
|
fields, and another object which is used to map author usernames to
|
|
1062
1051
|
real names. Our input looks like:
|
|
1063
1052
|
|
|
1064
|
-
{"posts": [{"title": "
|
|
1053
|
+
{"posts": [{"title": "First post", "author": "anon"},
|
|
1065
1054
|
{"title": "A well-written article", "author": "person1"}],
|
|
1066
1055
|
"realnames": {"anon": "Anonymous Coward",
|
|
1067
1056
|
"person1": "Person McPherson"}}
|
|
@@ -1069,7 +1058,7 @@ sections:
|
|
|
1069
1058
|
We want to produce the posts with the author field containing a real
|
|
1070
1059
|
name, as in:
|
|
1071
1060
|
|
|
1072
|
-
{"title": "
|
|
1061
|
+
{"title": "First post", "author": "Anonymous Coward"}
|
|
1073
1062
|
{"title": "A well-written article", "author": "Person McPherson"}
|
|
1074
1063
|
|
|
1075
1064
|
We use a variable, $names, to store the realnames object, so that we
|
|
@@ -1133,29 +1122,29 @@ sections:
|
|
|
1133
1122
|
input: '[[1,2],[10,20]]'
|
|
1134
1123
|
output: ['[[1,2,1,2], [10,20,1,2]]']
|
|
1135
1124
|
|
|
1136
|
-
- title:
|
|
1125
|
+
- title: "`reduce`"
|
|
1137
1126
|
body: |
|
|
1138
1127
|
|
|
1139
|
-
The `reduce` syntax
|
|
1140
|
-
|
|
1141
|
-
|
|
1128
|
+
The `reduce` syntax allows you to combine all of the results of
|
|
1129
|
+
an expression by accumulating them into a single answer.
|
|
1130
|
+
The form is `reduce EXP as $var (INIT; UPDATE)`.
|
|
1131
|
+
As an example, we'll pass `[1,2,3]` to this expression:
|
|
1142
1132
|
|
|
1143
1133
|
reduce .[] as $item (0; . + $item)
|
|
1144
1134
|
|
|
1145
1135
|
For each result that `.[]` produces, `. + $item` is run to
|
|
1146
|
-
accumulate a running total, starting from 0
|
|
1147
|
-
example, `.[]` produces the results
|
|
1148
|
-
effect is similar to running something like this:
|
|
1136
|
+
accumulate a running total, starting from 0 as the input value.
|
|
1137
|
+
In this example, `.[]` produces the results `1`, `2`, and `3`,
|
|
1138
|
+
so the effect is similar to running something like this:
|
|
1149
1139
|
|
|
1150
|
-
0 |
|
|
1151
|
-
|
|
1152
|
-
|
|
1140
|
+
0 | 1 as $item | . + $item |
|
|
1141
|
+
2 as $item | . + $item |
|
|
1142
|
+
3 as $item | . + $item
|
|
1153
1143
|
|
|
1154
1144
|
examples:
|
|
1155
1145
|
- program: 'reduce .[] as $item (0; . + $item)'
|
|
1156
|
-
input: '[
|
|
1157
|
-
output: ['
|
|
1158
|
-
|
|
1146
|
+
input: '[1,2,3,4,5]'
|
|
1147
|
+
output: ['15']
|
|
1159
1148
|
|
|
1160
1149
|
- title: Assignment
|
|
1161
1150
|
body: |
|
|
@@ -1169,7 +1158,7 @@ sections:
|
|
|
1169
1158
|
If an object has two fields which are arrays, `.foo` and `.bar`,
|
|
1170
1159
|
and you append something to `.foo`, then `.bar` will not get
|
|
1171
1160
|
bigger. Even if you've just set `.bar = .foo`. If you're used to
|
|
1172
|
-
programming in languages like Python, Java, Ruby,
|
|
1161
|
+
programming in languages like Python, Java, Ruby, JavaScript,
|
|
1173
1162
|
etc. then you can think of it as though jq does a full deep copy
|
|
1174
1163
|
of every object before it does the assignment (for performance,
|
|
1175
1164
|
it doesn't actually do that, but that's the general idea).
|
|
@@ -1186,7 +1175,7 @@ sections:
|
|
|
1186
1175
|
.foo = .bar | .foo.baz = 1
|
|
1187
1176
|
|
|
1188
1177
|
will not have the side-effect of setting .bar.baz to be set
|
|
1189
|
-
to 1, as the similar-looking program in
|
|
1178
|
+
to 1, as the similar-looking program in JavaScript, Python,
|
|
1190
1179
|
Ruby or other languages would. Unlike these languages (but
|
|
1191
1180
|
like Haskell and some other functional languages), there is
|
|
1192
1181
|
no notion of two arrays or objects being "the same array" or
|
|
@@ -1232,7 +1221,7 @@ sections:
|
|
|
1232
1221
|
- title: Complex assignments
|
|
1233
1222
|
body: |
|
|
1234
1223
|
Lots more things are allowed on the left-hand side of a jq assignment
|
|
1235
|
-
than in most
|
|
1224
|
+
than in most languages. We've already seen simple field accesses on
|
|
1236
1225
|
the left hand side, and it's no surprise that array accesses work just
|
|
1237
1226
|
as well:
|
|
1238
1227
|
|