@port-labs/jq-node-bindings 1.0.4 → 1.1.0-dev
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/.claude/settings.local.json +12 -0
- package/configure +6 -5
- package/deps/jq/.claude/settings.local.json +7 -0
- package/deps/jq/.gitattributes +1 -3
- package/deps/jq/AUTHORS +55 -1
- package/deps/jq/COPYING +40 -0
- package/deps/jq/Makefile.am +40 -36
- package/deps/jq/NEWS.md +277 -2
- package/deps/jq/README.md +23 -5
- package/deps/jq/compile-ios.sh +1 -1
- package/deps/jq/config/m4/check-math-func.m4 +2 -2
- package/deps/jq/config/m4/find-func-no-libs2.m4 +3 -3
- package/deps/jq/configure.ac +10 -18
- package/deps/jq/docs/Pipfile.lock +368 -313
- package/deps/jq/docs/README.md +3 -4
- package/deps/jq/docs/build_manpage.py +1 -1
- package/deps/jq/docs/build_mantests.py +1 -1
- package/deps/jq/docs/build_website.py +1 -8
- package/deps/jq/docs/content/download/default.yml +49 -9
- package/deps/jq/docs/content/index.yml +9 -0
- package/deps/jq/docs/content/manual/{manual.yml → dev/manual.yml} +218 -61
- package/deps/jq/docs/content/manual/v1.3/manual.yml +0 -5
- package/deps/jq/docs/content/manual/v1.4/manual.yml +0 -5
- package/deps/jq/docs/content/manual/v1.5/manual.yml +3 -8
- package/deps/jq/docs/content/manual/v1.6/manual.yml +3 -8
- package/deps/jq/docs/content/manual/v1.7/manual.yml +499 -500
- package/deps/jq/docs/content/manual/v1.8/manual.yml +3858 -0
- package/deps/jq/docs/content/tutorial/default.yml +3 -3
- package/deps/jq/docs/manual_schema.yml +0 -3
- package/deps/jq/docs/public/CNAME +1 -0
- package/deps/jq/docs/templates/index.html.j2 +10 -10
- package/deps/jq/docs/templates/manual.html.j2 +14 -3
- package/deps/jq/docs/templates/shared/_head.html.j2 +8 -3
- package/deps/jq/docs/templates/shared/_navbar.html.j2 +4 -4
- package/deps/jq/jq.1.prebuilt +219 -44
- package/deps/jq/jq.spec +2 -2
- package/deps/jq/libjq.pc.in +1 -1
- package/deps/jq/scripts/version +1 -1
- 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.8.0/jq-1.8.0.tar.gz.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-1.8.0.zip.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-amd64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-arm64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-armel.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-armhf.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-i386.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mips.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mips64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mips64el.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mips64r6.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mips64r6el.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mipsel.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mipsr6.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-mipsr6el.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-powerpc.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-ppc64el.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-riscv64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux-s390x.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-macos-amd64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-macos-arm64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-windows-amd64.exe.asc +16 -0
- package/deps/jq/sig/v1.8.0/jq-windows-i386.exe.asc +16 -0
- package/deps/jq/sig/v1.8.0/sha256sum.txt +26 -0
- package/deps/jq/src/builtin.c +446 -271
- package/deps/jq/src/builtin.jq +25 -60
- package/deps/jq/src/bytecode.h +8 -3
- package/deps/jq/src/compile.c +22 -43
- package/deps/jq/src/compile.h +1 -1
- package/deps/jq/src/execute.c +20 -25
- package/deps/jq/src/jq_test.c +113 -44
- package/deps/jq/src/jv.c +134 -42
- package/deps/jq/src/jv.h +10 -3
- package/deps/jq/src/jv_alloc.c +8 -5
- package/deps/jq/src/jv_alloc.h +0 -1
- package/deps/jq/src/jv_aux.c +41 -8
- package/deps/jq/src/jv_dtoa.c +4 -12
- package/deps/jq/src/jv_dtoa_tsd.c +5 -4
- package/deps/jq/src/jv_dtoa_tsd.h +1 -1
- package/deps/jq/src/jv_parse.c +5 -3
- package/deps/jq/src/jv_print.c +87 -65
- package/deps/jq/src/jv_unicode.c +18 -0
- package/deps/jq/src/jv_unicode.h +2 -0
- package/deps/jq/src/lexer.c +303 -278
- package/deps/jq/src/lexer.h +5 -4
- package/deps/jq/src/lexer.l +8 -2
- package/deps/jq/src/libm.h +15 -5
- package/deps/jq/src/linker.c +6 -4
- package/deps/jq/src/locfile.c +12 -12
- package/deps/jq/src/main.c +204 -270
- package/deps/jq/src/parser.c +1105 -1273
- package/deps/jq/src/parser.y +149 -181
- package/deps/jq/src/util.c +46 -48
- package/deps/jq/src/util.h +1 -1
- package/deps/jq/tests/base64.test +12 -0
- package/deps/jq/tests/jq.test +429 -37
- package/deps/jq/tests/jq_fuzz_load_file.c +1 -0
- package/deps/jq/tests/man.test +46 -13
- package/deps/jq/tests/manonig.test +13 -0
- package/deps/jq/tests/onig.test +40 -2
- package/deps/jq/tests/optional.test +4 -12
- package/deps/jq/tests/setup +5 -1
- package/deps/jq/tests/shtest +358 -130
- package/deps/jq/tests/uri.test +38 -0
- package/deps/jq/tests/uritest +5 -0
- package/deps/jq/{src → vendor}/decNumber/decBasic.c +1 -1
- package/deps/jq/{src → vendor}/decNumber/decCommon.c +1 -1
- package/deps/jq/{src → vendor}/decNumber/decNumber.c +4 -4
- package/deps/jq/{modules → vendor}/oniguruma/CMakeLists.txt +5 -3
- package/deps/jq/{modules → vendor}/oniguruma/HISTORY +45 -7
- package/deps/jq/{modules → vendor}/oniguruma/Makefile.am +1 -1
- package/deps/jq/{modules → vendor}/oniguruma/README.md +10 -23
- package/deps/jq/{modules → vendor}/oniguruma/compile +29 -13
- package/deps/jq/{modules → vendor}/oniguruma/config.guess +91 -27
- package/deps/jq/{modules → vendor}/oniguruma/config.sub +716 -242
- package/deps/jq/{modules → vendor}/oniguruma/configure.ac +2 -2
- package/deps/jq/{modules → vendor}/oniguruma/depcomp +10 -9
- package/deps/jq/{modules → vendor}/oniguruma/doc/API +3 -1
- package/deps/jq/{modules → vendor}/oniguruma/doc/API.ja +3 -1
- package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.BUILTIN +10 -1
- package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.BUILTIN.ja +9 -1
- package/deps/jq/{modules → vendor}/oniguruma/doc/RE +12 -13
- package/deps/jq/{modules → vendor}/oniguruma/doc/RE.ja +12 -13
- package/deps/jq/{modules → vendor}/oniguruma/doc/SYNTAX.md +202 -167
- package/deps/jq/{modules → vendor}/oniguruma/doc/UNICODE_PROPERTIES +33 -1
- package/deps/jq/vendor/oniguruma/doc/onig_syn_md.c +667 -0
- package/deps/jq/{modules → vendor}/oniguruma/harnesses/base.c +1 -1
- package/deps/jq/{modules → vendor}/oniguruma/install-sh +9 -9
- package/deps/jq/{modules → vendor}/oniguruma/missing +50 -29
- package/deps/jq/{modules → vendor}/oniguruma/sample/callback_each_match.c +1 -3
- package/deps/jq/vendor/oniguruma/sbom.cdx.json +44 -0
- package/deps/jq/{modules → vendor}/oniguruma/src/ascii.c +4 -1
- package/deps/jq/{modules → vendor}/oniguruma/src/gperf_fold_key_conv.py +4 -4
- package/deps/jq/{modules → vendor}/oniguruma/src/gperf_unfold_key_conv.py +4 -4
- package/deps/jq/vendor/oniguruma/src/make_unicode_egcb.sh +7 -0
- package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_egcb_data.py +20 -19
- package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_fold.sh +5 -5
- package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_fold_data.py +37 -37
- package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_property.sh +2 -2
- package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_property_data.py +66 -65
- package/deps/jq/vendor/oniguruma/src/make_unicode_wb.sh +7 -0
- package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_wb_data.py +20 -19
- package/deps/jq/{modules → vendor}/oniguruma/src/oniguruma.h +6 -3
- package/deps/jq/{modules → vendor}/oniguruma/src/regcomp.c +14 -6
- package/deps/jq/{modules → vendor}/oniguruma/src/regerror.c +2 -2
- package/deps/jq/{modules → vendor}/oniguruma/src/regexec.c +85 -14
- package/deps/jq/{modules → vendor}/oniguruma/src/regint.h +17 -4
- package/deps/jq/{modules → vendor}/oniguruma/src/regparse.c +115 -27
- package/deps/jq/{modules → vendor}/oniguruma/src/regsyntax.c +10 -7
- package/deps/jq/{modules → vendor}/oniguruma/src/st.c +49 -75
- package/deps/jq/{modules → vendor}/oniguruma/src/st.h +3 -10
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_egcb_data.c +54 -49
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_fold1_key.c +1567 -1507
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_fold2_key.c +1 -1
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_fold3_key.c +1 -1
- package/deps/jq/vendor/oniguruma/src/unicode_fold_data.c +1619 -0
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_property_data.c +5520 -4178
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_property_data_posix.c +239 -83
- package/deps/jq/vendor/oniguruma/src/unicode_unfold_key.c +3497 -0
- package/deps/jq/{modules → vendor}/oniguruma/src/unicode_wb_data.c +51 -19
- package/deps/jq/{modules → vendor}/oniguruma/src/utf16_be.c +3 -2
- package/deps/jq/{modules → vendor}/oniguruma/src/utf16_le.c +3 -2
- package/deps/jq/{modules → vendor}/oniguruma/test/test_back.c +3 -3
- package/deps/jq/{modules → vendor}/oniguruma/test/test_options.c +2 -2
- package/deps/jq/{modules → vendor}/oniguruma/test/test_syntax.c +54 -2
- package/deps/jq/{modules → vendor}/oniguruma/test/test_utf8.c +19 -5
- package/deps/jq/{modules → vendor}/oniguruma/test/testc.c +1 -1
- package/deps/jq/{modules → vendor}/oniguruma/test/testp.c +1 -1
- package/deps/jq/{modules → vendor}/oniguruma/test-driver +13 -6
- package/deps/jq/{modules → vendor}/oniguruma/windows/CMakeLists.txt +1 -1
- package/index.d.ts +2 -1
- package/lib/index.js +1 -0
- package/lib/jq.js +2 -1
- package/package.json +4 -3
- package/test/santiy-async.test.js +4 -4
- package/test/santiy.test.js +4 -4
- package/test/template.test.js +6 -6
- package/deps/jq/modules/oniguruma/src/make_unicode_egcb.sh +0 -7
- package/deps/jq/modules/oniguruma/src/make_unicode_wb.sh +0 -7
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +0 -1592
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +0 -3394
- package/deps/jq/scripts/update-website +0 -30
- /package/deps/jq/{src → vendor}/decNumber/ICU-license.html +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decContext.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decContext.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decDPD.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decDouble.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decDouble.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decNumber.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decNumberLocal.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decPacked.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decPacked.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decQuad.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decQuad.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decSingle.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decSingle.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decimal128.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decimal128.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decimal32.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decimal32.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decimal64.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decimal64.h +0 -0
- /package/deps/jq/{src → vendor}/decNumber/decnumber.pdf +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example1.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example2.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example3.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example4.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example5.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example6.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example7.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/example8.c +0 -0
- /package/deps/jq/{src → vendor}/decNumber/readme.txt +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/.travis.yml +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/AUTHORS +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/COPYING +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/ChangeLog +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/NEWS +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/README +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/README_japanese +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/autogen.sh +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/cmake/Config.cmake.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.API +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.API.ja +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/doc/FAQ +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/doc/FAQ.ja +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/harnesses/ascii_compatible.dict +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/harnesses/deluxe.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/harnesses/dict_conv.py +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/harnesses/fuzzer.options +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/harnesses/libfuzzer-onig.cpp +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/harnesses/regset.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/index.html +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/index_ja.html +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/m4/.whatever +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/make_win.bat +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/make_win32.bat +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/make_win64.bat +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/onig-config.cmake.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/onig-config.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/oniguruma.pc.cmake.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/oniguruma.pc.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/CMakeLists.txt +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/Makefile.am +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/bug_fix.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/callout.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/count.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/crnl.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/echo.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/encode.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/listcap.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/names.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/posix.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/regset.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/scan.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/simple.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/sql.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/syntax.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/sample/user_property.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/Makefile.am +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/Makefile.windows +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/big5.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.cmake.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.win32 +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.win64 +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.windows.in +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/cp1251.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/euc_jp.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/euc_jp_prop.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/euc_jp_prop.gperf +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/euc_kr.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/euc_tw.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/gb18030.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_1.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_10.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_11.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_13.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_14.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_15.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_16.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_2.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_3.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_4.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_5.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_6.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_7.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_8.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_9.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/koi8.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/koi8_r.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/make_property.sh +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/mktable.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/onig_init.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/oniggnu.h +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/onigposix.h +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regenc.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regenc.h +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regext.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/reggnu.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regparse.h +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regposerr.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regposix.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regtrav.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/regversion.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/sjis.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/sjis_prop.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/sjis_prop.gperf +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/unicode.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/utf32_be.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/utf32_le.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/src/utf8.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/test/CMakeLists.txt +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/test/Makefile.am +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/test/test.sh +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/test/test_regset.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/test/testu.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/stub.c +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_back.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_regset.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_syntax.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_utf8.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/testc.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/testu.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/tis.config +0 -0
- /package/deps/jq/{modules → vendor}/oniguruma/windows/testc.c +0 -0
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
headline: jq Manual (development version)
|
|
3
3
|
|
|
4
|
-
history: |
|
|
5
|
-
|
|
6
|
-
*For released versions, see [jq 1.7](./v1.7/), [jq 1.6](./v1.6/), [jq 1.5](./v1.5/),
|
|
7
|
-
[jq 1.4](./v1.4/) or [jq 1.3](./v1.3/).*
|
|
8
|
-
|
|
9
4
|
body: |
|
|
10
5
|
|
|
11
6
|
A jq program is a "filter": it takes an input, and produces an
|
|
@@ -226,12 +221,13 @@ sections:
|
|
|
226
221
|
RS. This mode also parses the output of jq without the `--seq`
|
|
227
222
|
option.
|
|
228
223
|
|
|
229
|
-
* `-f
|
|
224
|
+
* `-f` / `--from-file`:
|
|
230
225
|
|
|
231
|
-
Read filter from
|
|
232
|
-
awk's -f option.
|
|
226
|
+
Read the filter from a file rather than from a command line,
|
|
227
|
+
like awk's -f option. This changes the filter argument to be
|
|
228
|
+
interpreted as a filename, instead of the source of a program.
|
|
233
229
|
|
|
234
|
-
* `-L directory`:
|
|
230
|
+
* `-L directory` / `--library-path directory`:
|
|
235
231
|
|
|
236
232
|
Prepend `directory` to the search list for modules. If this
|
|
237
233
|
option is used then no builtin search list is used. See the
|
|
@@ -246,7 +242,8 @@ sections:
|
|
|
246
242
|
bind `$foo` to `"123"`.
|
|
247
243
|
|
|
248
244
|
Named arguments are also available to the jq program as
|
|
249
|
-
`$ARGS.named`.
|
|
245
|
+
`$ARGS.named`. When the name is not a valid identifier, this is
|
|
246
|
+
the only way to access it.
|
|
250
247
|
|
|
251
248
|
* `--argjson name JSON-text`:
|
|
252
249
|
|
|
@@ -357,10 +354,13 @@ sections:
|
|
|
357
354
|
|
|
358
355
|
The way in which jq handles numbers has changed over time
|
|
359
356
|
and further changes are likely within the parameters set by
|
|
360
|
-
the relevant JSON standards.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
357
|
+
the relevant JSON standards. Moreover, build configuration
|
|
358
|
+
options can alter how jq processes numbers.
|
|
359
|
+
|
|
360
|
+
The following remarks are therefore offered with the
|
|
361
|
+
understanding that they are intended to be descriptive of the
|
|
362
|
+
current version of jq and should not be interpreted as being
|
|
363
|
+
prescriptive:
|
|
364
364
|
|
|
365
365
|
(1) Any arithmetic operation on a number that has not
|
|
366
366
|
already been converted to an IEEE754 double precision
|
|
@@ -368,17 +368,21 @@ sections:
|
|
|
368
368
|
representation.
|
|
369
369
|
|
|
370
370
|
(2) jq will attempt to maintain the original decimal
|
|
371
|
-
precision of number literals
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
(3) In jq programs, a leading minus sign will trigger the
|
|
376
|
-
conversion of the number to an IEEE754 representation.
|
|
371
|
+
precision of number literals (if the `--disable-decnum`
|
|
372
|
+
build configuration option was not used), but in expressions
|
|
373
|
+
such `1E1234567890`, precision will be lost if the exponent
|
|
374
|
+
is too large.
|
|
377
375
|
|
|
378
|
-
(
|
|
376
|
+
(3) Comparisons are carried out using the untruncated
|
|
379
377
|
big decimal representation of numbers if available, as
|
|
380
378
|
illustrated in one of the following examples.
|
|
381
379
|
|
|
380
|
+
The examples below use the builtin function `have_decnum` in
|
|
381
|
+
order to demonstrate the expected effects of using / not
|
|
382
|
+
using the `--disable-decnum` build configuration option, and
|
|
383
|
+
also to allow automated tests derived from these examples to
|
|
384
|
+
pass regardless of whether that option is used.
|
|
385
|
+
|
|
382
386
|
examples:
|
|
383
387
|
- program: '.'
|
|
384
388
|
input: '"Hello, world!"'
|
|
@@ -388,21 +392,25 @@ sections:
|
|
|
388
392
|
input: '0.12345678901234567890123456789'
|
|
389
393
|
output: ['0.12345678901234567890123456789']
|
|
390
394
|
|
|
391
|
-
- program: '[., tojson]'
|
|
395
|
+
- program: '[., tojson] == if have_decnum then [12345678909876543212345,"12345678909876543212345"] else [12345678909876543000000,"12345678909876543000000"] end'
|
|
392
396
|
input: '12345678909876543212345'
|
|
393
|
-
output: ['
|
|
397
|
+
output: ['true']
|
|
398
|
+
|
|
399
|
+
- program: '[1234567890987654321,-1234567890987654321 | tojson] == if have_decnum then ["1234567890987654321","-1234567890987654321"] else ["1234567890987654400","-1234567890987654400"] end'
|
|
400
|
+
input: 'null'
|
|
401
|
+
output: ['true']
|
|
394
402
|
|
|
395
403
|
- program: '. < 0.12345678901234567890123456788'
|
|
396
404
|
input: '0.12345678901234567890123456789'
|
|
397
405
|
output: ['false']
|
|
398
406
|
|
|
399
|
-
- program: 'map([., . == 1]) | tojson'
|
|
407
|
+
- program: 'map([., . == 1]) | tojson == if have_decnum then "[[1,true],[1.000,true],[1.0,true],[1.00,true]]" else "[[1,true],[1,true],[1,true],[1,true]]" end'
|
|
400
408
|
input: '[1, 1.000, 1.0, 100e-2]'
|
|
401
|
-
output: ['
|
|
409
|
+
output: ['true']
|
|
402
410
|
|
|
403
|
-
- program: '. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000)'
|
|
411
|
+
- program: '. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000) | . == if have_decnum then [true, false] else [false, false] end'
|
|
404
412
|
input: '10000000000000000000000000000001'
|
|
405
|
-
output: ['
|
|
413
|
+
output: ['true']
|
|
406
414
|
|
|
407
415
|
- title: "Object Identifier-Index: `.foo`, `.foo.bar`"
|
|
408
416
|
body: |
|
|
@@ -568,7 +576,7 @@ sections:
|
|
|
568
576
|
.bar`, produces both the "foo" fields and "bar" fields as
|
|
569
577
|
separate outputs.
|
|
570
578
|
|
|
571
|
-
The `,` operator is one way to
|
|
579
|
+
The `,` operator is one way to construct generators.
|
|
572
580
|
|
|
573
581
|
examples:
|
|
574
582
|
- program: '.foo, .bar'
|
|
@@ -1004,15 +1012,15 @@ sections:
|
|
|
1004
1012
|
|
|
1005
1013
|
The key difference between `map(f)` and `map_values(f)` is
|
|
1006
1014
|
that the former simply forms an array from all the values of
|
|
1007
|
-
`($x|f)` for each value,
|
|
1015
|
+
`($x|f)` for each value, `$x`, in the input array or object,
|
|
1008
1016
|
but `map_values(f)` only uses `first($x|f)`.
|
|
1009
1017
|
|
|
1010
|
-
Specifically, for object inputs, `
|
|
1018
|
+
Specifically, for object inputs, `map_values(f)` constructs
|
|
1011
1019
|
the output object by examining in turn the value of
|
|
1012
|
-
`first(.[$k]|f)` for each key,
|
|
1020
|
+
`first(.[$k]|f)` for each key, `$k`, of the input. If this
|
|
1013
1021
|
expression produces no values, then the corresponding key
|
|
1014
1022
|
will be dropped; otherwise, the output object will have that
|
|
1015
|
-
value at the key,
|
|
1023
|
+
value at the key, `$k`.
|
|
1016
1024
|
|
|
1017
1025
|
Here are some examples to clarify the behavior of `map` and
|
|
1018
1026
|
`map_values` when applied to arrays. These examples assume the
|
|
@@ -1295,7 +1303,7 @@ sections:
|
|
|
1295
1303
|
input: '[1,[[],{"a":2}]]'
|
|
1296
1304
|
output: ['[[0],[1,1,"a"]]']
|
|
1297
1305
|
|
|
1298
|
-
- title: "`add`"
|
|
1306
|
+
- title: "`add`, `add(generator)`"
|
|
1299
1307
|
body: |
|
|
1300
1308
|
|
|
1301
1309
|
The filter `add` takes as input an array, and produces as
|
|
@@ -1306,6 +1314,9 @@ sections:
|
|
|
1306
1314
|
|
|
1307
1315
|
If the input is an empty array, `add` returns `null`.
|
|
1308
1316
|
|
|
1317
|
+
`add(generator)` operates on the given generator rather than
|
|
1318
|
+
the input.
|
|
1319
|
+
|
|
1309
1320
|
examples:
|
|
1310
1321
|
- program: add
|
|
1311
1322
|
input: '["a","b","c"]'
|
|
@@ -1316,6 +1327,9 @@ sections:
|
|
|
1316
1327
|
- program: add
|
|
1317
1328
|
input: '[]'
|
|
1318
1329
|
output: ["null"]
|
|
1330
|
+
- program: add(.[].a)
|
|
1331
|
+
input: '[{"a":3}, {"a":5}, {"b":6}]'
|
|
1332
|
+
output: ['8']
|
|
1319
1333
|
|
|
1320
1334
|
- title: "`any`, `any(condition)`, `any(generator; condition)`"
|
|
1321
1335
|
body: |
|
|
@@ -1463,6 +1477,18 @@ sections:
|
|
|
1463
1477
|
input: '[1, "1"]'
|
|
1464
1478
|
output: ['1', '1']
|
|
1465
1479
|
|
|
1480
|
+
- title: "`toboolean`"
|
|
1481
|
+
body: |
|
|
1482
|
+
|
|
1483
|
+
The `toboolean` function parses its input as a boolean. It
|
|
1484
|
+
will convert correctly-formatted strings to their boolean
|
|
1485
|
+
equivalent, leave booleans alone, and give an error on all other input.
|
|
1486
|
+
|
|
1487
|
+
examples:
|
|
1488
|
+
- program: '.[] | toboolean'
|
|
1489
|
+
input: '["true", "false", true, false]'
|
|
1490
|
+
output: ['true', 'false', 'true', 'false']
|
|
1491
|
+
|
|
1466
1492
|
- title: "`tostring`"
|
|
1467
1493
|
body: |
|
|
1468
1494
|
|
|
@@ -1772,6 +1798,36 @@ sections:
|
|
|
1772
1798
|
input: '["fo", "foo", "barfoo", "foobar", "foob"]'
|
|
1773
1799
|
output: ['["fo","","bar","foobar","foob"]']
|
|
1774
1800
|
|
|
1801
|
+
- title: "`trimstr(str)`"
|
|
1802
|
+
body: |
|
|
1803
|
+
|
|
1804
|
+
Outputs its input with the given string removed at both ends, if it
|
|
1805
|
+
starts or ends with it.
|
|
1806
|
+
|
|
1807
|
+
examples:
|
|
1808
|
+
- program: '[.[]|trimstr("foo")]'
|
|
1809
|
+
input: '["fo", "foo", "barfoo", "foobarfoo", "foob"]'
|
|
1810
|
+
output: ['["fo","","bar","bar","b"]']
|
|
1811
|
+
|
|
1812
|
+
- title: "`trim`, `ltrim`, `rtrim`"
|
|
1813
|
+
body: |
|
|
1814
|
+
|
|
1815
|
+
`trim` trims both leading and trailing whitespace.
|
|
1816
|
+
|
|
1817
|
+
`ltrim` trims only leading (left side) whitespace.
|
|
1818
|
+
|
|
1819
|
+
`rtrim` trims only trailing (right side) whitespace.
|
|
1820
|
+
|
|
1821
|
+
Whitespace characters are the usual `" "`, `"\n"` `"\t"`, `"\r"`
|
|
1822
|
+
and also all characters in the Unicode character database with the
|
|
1823
|
+
whitespace property. Note that what considers whitespace might
|
|
1824
|
+
change in the future.
|
|
1825
|
+
|
|
1826
|
+
examples:
|
|
1827
|
+
- program: 'trim, ltrim, rtrim'
|
|
1828
|
+
input: '" abc "'
|
|
1829
|
+
output: ['"abc"', '"abc "', '" abc"']
|
|
1830
|
+
|
|
1775
1831
|
- title: "`explode`"
|
|
1776
1832
|
body: |
|
|
1777
1833
|
|
|
@@ -1973,6 +2029,19 @@ sections:
|
|
|
1973
2029
|
output:
|
|
1974
2030
|
- '[{"a":{"b":2}}]'
|
|
1975
2031
|
|
|
2032
|
+
- title: "`have_literal_numbers`"
|
|
2033
|
+
body: |
|
|
2034
|
+
|
|
2035
|
+
This builtin returns true if jq's build configuration
|
|
2036
|
+
includes support for preservation of input number literals.
|
|
2037
|
+
|
|
2038
|
+
- title: "`have_decnum`"
|
|
2039
|
+
body: |
|
|
2040
|
+
|
|
2041
|
+
This builtin returns true if jq was built with "decnum",
|
|
2042
|
+
which is the current literal number preserving numeric
|
|
2043
|
+
backend implementation for jq.
|
|
2044
|
+
|
|
1976
2045
|
- title: "`$JQ_BUILD_CONFIGURATION`"
|
|
1977
2046
|
body: |
|
|
1978
2047
|
|
|
@@ -1983,7 +2052,7 @@ sections:
|
|
|
1983
2052
|
future to include the version strings for the build
|
|
1984
2053
|
tooling used.
|
|
1985
2054
|
|
|
1986
|
-
Note that this can be
|
|
2055
|
+
Note that this can be overridden in the command-line
|
|
1987
2056
|
with `--arg` and related options.
|
|
1988
2057
|
|
|
1989
2058
|
- title: "`$ENV`, `env`"
|
|
@@ -2098,6 +2167,11 @@ sections:
|
|
|
2098
2167
|
Applies percent-encoding, by mapping all reserved URI
|
|
2099
2168
|
characters to a `%XX` sequence.
|
|
2100
2169
|
|
|
2170
|
+
* `@urid`:
|
|
2171
|
+
|
|
2172
|
+
The inverse of `@uri`, applies percent-decoding, by mapping
|
|
2173
|
+
all `%XX` sequences to their corresponding URI characters.
|
|
2174
|
+
|
|
2101
2175
|
* `@csv`:
|
|
2102
2176
|
|
|
2103
2177
|
The input must be an array, and it is rendered as CSV
|
|
@@ -2210,7 +2284,7 @@ sections:
|
|
|
2210
2284
|
|
|
2211
2285
|
The `strptime(fmt)` builtin parses input strings matching the
|
|
2212
2286
|
`fmt` argument. The output is in the "broken down time"
|
|
2213
|
-
representation consumed by `
|
|
2287
|
+
representation consumed by `mktime` and output by `gmtime`.
|
|
2214
2288
|
|
|
2215
2289
|
The `strftime(fmt)` builtin formats a time (GMT) with the
|
|
2216
2290
|
given format. The `strflocaltime` does the same, but using
|
|
@@ -2242,13 +2316,13 @@ sections:
|
|
|
2242
2316
|
|
|
2243
2317
|
jq provides a few SQL-style operators.
|
|
2244
2318
|
|
|
2245
|
-
* INDEX(stream; index_expression)
|
|
2319
|
+
* `INDEX(stream; index_expression)`:
|
|
2246
2320
|
|
|
2247
2321
|
This builtin produces an object whose keys are computed by
|
|
2248
2322
|
the given index expression applied to each value from the
|
|
2249
2323
|
given stream.
|
|
2250
2324
|
|
|
2251
|
-
* JOIN($idx; stream; idx_expr; join_expr)
|
|
2325
|
+
* `JOIN($idx; stream; idx_expr; join_expr)`:
|
|
2252
2326
|
|
|
2253
2327
|
This builtin joins the values from the given stream to the
|
|
2254
2328
|
given index. The index's keys are computed by applying the
|
|
@@ -2257,22 +2331,22 @@ sections:
|
|
|
2257
2331
|
value from the index is fed to the given join expression to
|
|
2258
2332
|
produce each result.
|
|
2259
2333
|
|
|
2260
|
-
* JOIN($idx; stream; idx_expr)
|
|
2334
|
+
* `JOIN($idx; stream; idx_expr)`:
|
|
2261
2335
|
|
|
2262
2336
|
Same as `JOIN($idx; stream; idx_expr; .)`.
|
|
2263
2337
|
|
|
2264
|
-
* JOIN($idx; idx_expr)
|
|
2338
|
+
* `JOIN($idx; idx_expr)`:
|
|
2265
2339
|
|
|
2266
2340
|
This builtin joins the input `.` to the given index, applying
|
|
2267
2341
|
the given index expression to `.` to compute the index key.
|
|
2268
2342
|
The join operation is as described above.
|
|
2269
2343
|
|
|
2270
|
-
* IN(s)
|
|
2344
|
+
* `IN(s)`:
|
|
2271
2345
|
|
|
2272
2346
|
This builtin outputs `true` if `.` appears in the given
|
|
2273
2347
|
stream, otherwise it outputs `false`.
|
|
2274
2348
|
|
|
2275
|
-
* IN(source; s)
|
|
2349
|
+
* `IN(source; s)`:
|
|
2276
2350
|
|
|
2277
2351
|
This builtin outputs `true` if any value in the source stream
|
|
2278
2352
|
appears in the second stream, otherwise it outputs `false`.
|
|
@@ -2491,7 +2565,7 @@ sections:
|
|
|
2491
2565
|
label $out | ... break $out ...
|
|
2492
2566
|
|
|
2493
2567
|
The `break $label_name` expression will cause the program to
|
|
2494
|
-
|
|
2568
|
+
act as though the nearest (to the left) `label $label_name`
|
|
2495
2569
|
produced `empty`.
|
|
2496
2570
|
|
|
2497
2571
|
The relationship between the `break` and corresponding `label`
|
|
@@ -2649,12 +2723,17 @@ sections:
|
|
|
2649
2723
|
that match the regex in accordance with the flags, if any
|
|
2650
2724
|
have been specified. If there is no match, the stream is empty.
|
|
2651
2725
|
To capture all the matches for each input string, use the idiom
|
|
2652
|
-
`[ expr ]`, e.g. `[ scan(regex) ]`.
|
|
2726
|
+
`[ expr ]`, e.g. `[ scan(regex) ]`. If the regex contains capturing
|
|
2727
|
+
groups, the filter emits a stream of arrays, each of which contains
|
|
2728
|
+
the captured strings.
|
|
2653
2729
|
|
|
2654
2730
|
examples:
|
|
2655
2731
|
- program: 'scan("c")'
|
|
2656
2732
|
input: '"abcdefabc"'
|
|
2657
2733
|
output: ['"c"', '"c"']
|
|
2734
|
+
- program: 'scan("(a+)(b+)")'
|
|
2735
|
+
input: '"abaabbaaabbb"'
|
|
2736
|
+
output: ['["a","b"]', '["aa","bb"]', '["aaa","bbb"]']
|
|
2658
2737
|
|
|
2659
2738
|
- title: "`split(regex; flags)`"
|
|
2660
2739
|
body: |
|
|
@@ -2680,6 +2759,9 @@ sections:
|
|
|
2680
2759
|
- program: 'splits(", *")'
|
|
2681
2760
|
input: '"ab,cd, ef, gh"'
|
|
2682
2761
|
output: ['"ab"','"cd"','"ef"','"gh"']
|
|
2762
|
+
- program: 'splits(",? *"; "n")'
|
|
2763
|
+
input: '"ab,cd ef, gh"'
|
|
2764
|
+
output: ['"ab"','"cd"','"ef"','"gh"']
|
|
2683
2765
|
|
|
2684
2766
|
- title: "`sub(regex; tostring)`, `sub(regex; tostring; flags)`"
|
|
2685
2767
|
body: |
|
|
@@ -2794,7 +2876,7 @@ sections:
|
|
|
2794
2876
|
{"title": "First post", "author": "Anonymous Coward"}
|
|
2795
2877
|
{"title": "A well-written article", "author": "Person McPherson"}
|
|
2796
2878
|
|
|
2797
|
-
We use a variable,
|
|
2879
|
+
We use a variable, `$names`, to store the realnames object, so that we
|
|
2798
2880
|
can refer to it later when looking up author usernames:
|
|
2799
2881
|
|
|
2800
2882
|
.realnames as $names | .posts[] | {title, author: $names[.author]}
|
|
@@ -2989,16 +3071,26 @@ sections:
|
|
|
2989
3071
|
input: '[1,2,3]'
|
|
2990
3072
|
output: ['false']
|
|
2991
3073
|
|
|
2992
|
-
- title: "`limit(n;
|
|
3074
|
+
- title: "`limit(n; expr)`"
|
|
2993
3075
|
body: |
|
|
2994
3076
|
|
|
2995
|
-
The `limit` function extracts up to `n` outputs from `
|
|
3077
|
+
The `limit` function extracts up to `n` outputs from `expr`.
|
|
2996
3078
|
|
|
2997
3079
|
examples:
|
|
2998
|
-
- program: '[limit(3
|
|
3080
|
+
- program: '[limit(3; .[])]'
|
|
2999
3081
|
input: '[0,1,2,3,4,5,6,7,8,9]'
|
|
3000
3082
|
output: ['[0,1,2]']
|
|
3001
3083
|
|
|
3084
|
+
- title: "`skip(n; expr)`"
|
|
3085
|
+
body: |
|
|
3086
|
+
|
|
3087
|
+
The `skip` function skips the first `n` outputs from `expr`.
|
|
3088
|
+
|
|
3089
|
+
examples:
|
|
3090
|
+
- program: '[skip(3; .[])]'
|
|
3091
|
+
input: '[0,1,2,3,4,5,6,7,8,9]'
|
|
3092
|
+
output: ['[3,4,5,6,7,8,9]']
|
|
3093
|
+
|
|
3002
3094
|
- title: "`first(expr)`, `last(expr)`, `nth(n; expr)`"
|
|
3003
3095
|
body: |
|
|
3004
3096
|
|
|
@@ -3009,9 +3101,12 @@ sections:
|
|
|
3009
3101
|
Note that `nth(n; expr)` doesn't support negative values of `n`.
|
|
3010
3102
|
|
|
3011
3103
|
examples:
|
|
3012
|
-
- program: '[first(range(.)), last(range(.)), nth(
|
|
3104
|
+
- program: '[first(range(.)), last(range(.)), nth(5; range(.))]'
|
|
3013
3105
|
input: '10'
|
|
3014
3106
|
output: ['[0,9,5]']
|
|
3107
|
+
- program: '[first(empty), last(empty), nth(5; empty)]'
|
|
3108
|
+
input: 'null'
|
|
3109
|
+
output: ['[]']
|
|
3015
3110
|
|
|
3016
3111
|
- title: "`first`, `last`, `nth(n)`"
|
|
3017
3112
|
body: |
|
|
@@ -3160,9 +3255,8 @@ sections:
|
|
|
3160
3255
|
def _range:
|
|
3161
3256
|
if (by > 0 and . < upto) or (by < 0 and . > upto)
|
|
3162
3257
|
then ., ((.+by)|_range)
|
|
3163
|
-
else
|
|
3164
|
-
if by == 0 then init else init|_range end
|
|
3165
|
-
select((by > 0 and . < upto) or (by < 0 and . > upto));
|
|
3258
|
+
else empty end;
|
|
3259
|
+
if init == upto then empty elif by == 0 then init else init|_range end;
|
|
3166
3260
|
range(0; 10; 3)'
|
|
3167
3261
|
input: 'null'
|
|
3168
3262
|
output: ['0', '3', '6', '9']
|
|
@@ -3197,7 +3291,7 @@ sections:
|
|
|
3197
3291
|
One-input C math functions: `acos` `acosh` `asin` `asinh` `atan`
|
|
3198
3292
|
`atanh` `cbrt` `ceil` `cos` `cosh` `erf` `erfc` `exp` `exp10`
|
|
3199
3293
|
`exp2` `expm1` `fabs` `floor` `gamma` `j0` `j1` `lgamma` `log`
|
|
3200
|
-
`log10` `log1p` `log2` `logb` `nearbyint` `
|
|
3294
|
+
`log10` `log1p` `log2` `logb` `nearbyint` `rint` `round`
|
|
3201
3295
|
`significand` `sin` `sinh` `sqrt` `tan` `tanh` `tgamma` `trunc`
|
|
3202
3296
|
`y0` `y1`.
|
|
3203
3297
|
|
|
@@ -3239,7 +3333,7 @@ sections:
|
|
|
3239
3333
|
|
|
3240
3334
|
Outputs one new input.
|
|
3241
3335
|
|
|
3242
|
-
Note that when using `input` it is generally
|
|
3336
|
+
Note that when using `input` it is generally necessary to
|
|
3243
3337
|
invoke jq with the `-n` command-line option, otherwise
|
|
3244
3338
|
the first entity will be lost.
|
|
3245
3339
|
|
|
@@ -3316,8 +3410,8 @@ sections:
|
|
|
3316
3410
|
|
|
3317
3411
|
Several builtins are provided to make handling streams easier.
|
|
3318
3412
|
|
|
3319
|
-
The examples below use the streamed form of `[
|
|
3320
|
-
`[[0],
|
|
3413
|
+
The examples below use the streamed form of `["a",["b"]]`, which is
|
|
3414
|
+
`[[0],"a"],[[1,0],"b"],[[1,0]],[[1]]`.
|
|
3321
3415
|
|
|
3322
3416
|
Streaming forms include `[<path>, <leaf-value>]` (to indicate any
|
|
3323
3417
|
scalar value, empty array, or empty object), and `[<path>]` (to
|
|
@@ -3334,9 +3428,9 @@ sections:
|
|
|
3334
3428
|
given streaming expression.
|
|
3335
3429
|
|
|
3336
3430
|
examples:
|
|
3337
|
-
- program: 'truncate_stream([[0],
|
|
3431
|
+
- program: 'truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]])'
|
|
3338
3432
|
input: '1'
|
|
3339
|
-
output: ['[[0],
|
|
3433
|
+
output: ['[[0],"b"]', '[[0]]']
|
|
3340
3434
|
|
|
3341
3435
|
- title: "`fromstream(stream_expression)`"
|
|
3342
3436
|
body: |
|
|
@@ -3345,9 +3439,9 @@ sections:
|
|
|
3345
3439
|
outputs.
|
|
3346
3440
|
|
|
3347
3441
|
examples:
|
|
3348
|
-
- program: 'fromstream(1|truncate_stream([[0],
|
|
3442
|
+
- program: 'fromstream(1|truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]]))'
|
|
3349
3443
|
input: 'null'
|
|
3350
|
-
output: ['[
|
|
3444
|
+
output: ['["b"]']
|
|
3351
3445
|
|
|
3352
3446
|
- title: "`tostream`"
|
|
3353
3447
|
body: |
|
|
@@ -3537,6 +3631,68 @@ sections:
|
|
|
3537
3631
|
(.posts[] | select(.author == "stedolan") | .comments) |=
|
|
3538
3632
|
. + ["terrible."]
|
|
3539
3633
|
|
|
3634
|
+
- title: Comments
|
|
3635
|
+
|
|
3636
|
+
body: |
|
|
3637
|
+
|
|
3638
|
+
You can write comments in your jq filters using `#`.
|
|
3639
|
+
|
|
3640
|
+
A `#` character (not part of a string) starts a comment.
|
|
3641
|
+
All characters from `#` to the end of the line are ignored.
|
|
3642
|
+
|
|
3643
|
+
If the end of the line is preceded by an odd number of backslash
|
|
3644
|
+
characters, the following line is also considered part of the
|
|
3645
|
+
comment and is ignored.
|
|
3646
|
+
|
|
3647
|
+
For example, the following code outputs `[1,3,4,7]`
|
|
3648
|
+
|
|
3649
|
+
[
|
|
3650
|
+
1,
|
|
3651
|
+
# foo \
|
|
3652
|
+
2,
|
|
3653
|
+
# bar \\
|
|
3654
|
+
3,
|
|
3655
|
+
4, # baz \\\
|
|
3656
|
+
5, \
|
|
3657
|
+
6,
|
|
3658
|
+
7
|
|
3659
|
+
# comment \
|
|
3660
|
+
comment \
|
|
3661
|
+
comment
|
|
3662
|
+
]
|
|
3663
|
+
|
|
3664
|
+
Backslash continuing the comment on the next line can be useful
|
|
3665
|
+
when writing the "shebang" for a jq script:
|
|
3666
|
+
|
|
3667
|
+
#!/bin/sh --
|
|
3668
|
+
# total - Output the sum of the given arguments (or stdin)
|
|
3669
|
+
# usage: total [numbers...]
|
|
3670
|
+
# \
|
|
3671
|
+
exec jq --args -MRnf -- "$0" "$@"
|
|
3672
|
+
|
|
3673
|
+
$ARGS.positional |
|
|
3674
|
+
reduce (
|
|
3675
|
+
if . == []
|
|
3676
|
+
then inputs
|
|
3677
|
+
else .[]
|
|
3678
|
+
end |
|
|
3679
|
+
. as $dot |
|
|
3680
|
+
try tonumber catch false |
|
|
3681
|
+
if not or isnan then
|
|
3682
|
+
@json "total: Invalid number \($dot).\n" | halt_error(1)
|
|
3683
|
+
end
|
|
3684
|
+
) as $n (0; . + $n)
|
|
3685
|
+
|
|
3686
|
+
The `exec` line is considered a comment by jq, so it is ignored.
|
|
3687
|
+
But it is not ignored by `sh`, since in `sh` a backslash at the
|
|
3688
|
+
end of the line does not continue the comment.
|
|
3689
|
+
With this trick, when the script is invoked as `total 1 2`,
|
|
3690
|
+
`/bin/sh -- /path/to/total 1 2` will be run, and `sh` will then
|
|
3691
|
+
run `exec jq --args -MRnf -- /path/to/total 1 2` replacing itself
|
|
3692
|
+
with a `jq` interpreter invoked with the specified options (`-M`,
|
|
3693
|
+
`-R`, `-n`, `--args`), that evaluates the current file (`$0`),
|
|
3694
|
+
with the arguments (`$@`) that were passed to `sh`.
|
|
3695
|
+
|
|
3540
3696
|
- title: Modules
|
|
3541
3697
|
body: |
|
|
3542
3698
|
|
|
@@ -3547,7 +3703,7 @@ sections:
|
|
|
3547
3703
|
path (see below). The `import` and `include` directives allow the
|
|
3548
3704
|
importer to alter this path.
|
|
3549
3705
|
|
|
3550
|
-
Paths in the
|
|
3706
|
+
Paths in the search path are subject to various substitutions.
|
|
3551
3707
|
|
|
3552
3708
|
For paths starting with `~/`, the user's home directory is
|
|
3553
3709
|
substituted for `~`.
|
|
@@ -3581,7 +3737,8 @@ sections:
|
|
|
3581
3737
|
For example, with `-L$HOME/.jq` a module `foo` can be found in
|
|
3582
3738
|
`$HOME/.jq/foo.jq` and `$HOME/.jq/foo/foo.jq`.
|
|
3583
3739
|
|
|
3584
|
-
If
|
|
3740
|
+
If `.jq` exists in the user's home directory, and is a file (not a
|
|
3741
|
+
directory), it is automatically sourced into the main program.
|
|
3585
3742
|
|
|
3586
3743
|
entries:
|
|
3587
3744
|
- title: "`import RelativePathString as NAME [<metadata>];`"
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
headline: jq 1.5 Manual
|
|
3
3
|
|
|
4
|
-
history: |
|
|
5
|
-
|
|
6
|
-
*The manual for the development version of jq can be found
|
|
7
|
-
[here](../).*
|
|
8
|
-
|
|
9
4
|
body: |
|
|
10
5
|
|
|
11
6
|
A jq program is a "filter": it takes an input, and produces an
|
|
@@ -1768,7 +1763,7 @@ sections:
|
|
|
1768
1763
|
|
|
1769
1764
|
The `strptime(fmt)` builtin parses input strings matching the
|
|
1770
1765
|
`fmt` argument. The output is in the "broken down time"
|
|
1771
|
-
representation consumed by `
|
|
1766
|
+
representation consumed by `mktime` and output by `gmtime`.
|
|
1772
1767
|
|
|
1773
1768
|
The `strftime(fmt)` builtin formats a time with the given
|
|
1774
1769
|
format.
|
|
@@ -1958,7 +1953,7 @@ sections:
|
|
|
1958
1953
|
label $out | ... break $out ...
|
|
1959
1954
|
|
|
1960
1955
|
The `break $label_name` expression will cause the program to
|
|
1961
|
-
|
|
1956
|
+
act as though the nearest (to the left) `label $label_name`
|
|
1962
1957
|
produced `empty`.
|
|
1963
1958
|
|
|
1964
1959
|
The relationship between the `break` and corresponding `label`
|
|
@@ -2821,7 +2816,7 @@ sections:
|
|
|
2821
2816
|
path (see below). The `import` and `include` directives allow the
|
|
2822
2817
|
importer to alter this path.
|
|
2823
2818
|
|
|
2824
|
-
Paths in the
|
|
2819
|
+
Paths in the search path are subject to various substitutions.
|
|
2825
2820
|
|
|
2826
2821
|
For paths starting with "~/", the user's home directory is
|
|
2827
2822
|
substituted for "~".
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
headline: jq 1.6 Manual
|
|
3
3
|
|
|
4
|
-
history: |
|
|
5
|
-
|
|
6
|
-
*The manual for the development version of jq can be found
|
|
7
|
-
[here](../).*
|
|
8
|
-
|
|
9
4
|
body: |
|
|
10
5
|
|
|
11
6
|
A jq program is a "filter": it takes an input, and produces an
|
|
@@ -1978,7 +1973,7 @@ sections:
|
|
|
1978
1973
|
|
|
1979
1974
|
The `strptime(fmt)` builtin parses input strings matching the
|
|
1980
1975
|
`fmt` argument. The output is in the "broken down time"
|
|
1981
|
-
representation consumed by `
|
|
1976
|
+
representation consumed by `mktime` and output by `gmtime`.
|
|
1982
1977
|
|
|
1983
1978
|
The `strftime(fmt)` builtin formats a time (GMT) with the
|
|
1984
1979
|
given format. The `strflocaltime` does the same, but using
|
|
@@ -2217,7 +2212,7 @@ sections:
|
|
|
2217
2212
|
label $out | ... break $out ...
|
|
2218
2213
|
|
|
2219
2214
|
The `break $label_name` expression will cause the program to
|
|
2220
|
-
|
|
2215
|
+
act as though the nearest (to the left) `label $label_name`
|
|
2221
2216
|
produced `empty`.
|
|
2222
2217
|
|
|
2223
2218
|
The relationship between the `break` and corresponding `label`
|
|
@@ -3216,7 +3211,7 @@ sections:
|
|
|
3216
3211
|
path (see below). The `import` and `include` directives allow the
|
|
3217
3212
|
importer to alter this path.
|
|
3218
3213
|
|
|
3219
|
-
Paths in the
|
|
3214
|
+
Paths in the search path are subject to various substitutions.
|
|
3220
3215
|
|
|
3221
3216
|
For paths starting with "~/", the user's home directory is
|
|
3222
3217
|
substituted for "~".
|