@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
package/deps/jq/src/builtin.h
CHANGED
|
@@ -7,4 +7,22 @@
|
|
|
7
7
|
|
|
8
8
|
int builtins_bind(jq_state *, block*);
|
|
9
9
|
|
|
10
|
+
#define BINOPS \
|
|
11
|
+
BINOP(plus) \
|
|
12
|
+
BINOP(minus) \
|
|
13
|
+
BINOP(multiply) \
|
|
14
|
+
BINOP(divide) \
|
|
15
|
+
BINOP(mod) \
|
|
16
|
+
BINOP(equal) \
|
|
17
|
+
BINOP(notequal) \
|
|
18
|
+
BINOP(less) \
|
|
19
|
+
BINOP(lesseq) \
|
|
20
|
+
BINOP(greater) \
|
|
21
|
+
BINOP(greatereq) \
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
#define BINOP(name) jv binop_ ## name(jv, jv);
|
|
25
|
+
BINOPS
|
|
26
|
+
#undef BINOP
|
|
27
|
+
|
|
10
28
|
#endif
|
package/deps/jq/src/builtin.jq
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
def halt_error: halt_error(5);
|
|
2
|
-
def error: error
|
|
2
|
+
def error(msg): msg|error;
|
|
3
3
|
def map(f): [.[] | f];
|
|
4
4
|
def select(f): if f then . else empty end;
|
|
5
5
|
def sort_by(f): _sort_by_impl(map([f]));
|
|
@@ -8,17 +8,36 @@ def unique: group_by(.) | map(.[0]);
|
|
|
8
8
|
def unique_by(f): group_by(f) | map(.[0]);
|
|
9
9
|
def max_by(f): _max_by_impl(map([f]));
|
|
10
10
|
def min_by(f): _min_by_impl(map([f]));
|
|
11
|
-
def add: reduce
|
|
11
|
+
def add(f): reduce f as $x (null; . + $x);
|
|
12
|
+
def add: add(.[]);
|
|
12
13
|
def del(f): delpaths([path(f)]);
|
|
13
|
-
def
|
|
14
|
-
def
|
|
14
|
+
def abs: if . < 0 then - . else . end;
|
|
15
|
+
def _assign(paths; $value): reduce path(paths) as $p (.; setpath($p; $value));
|
|
16
|
+
def _modify(paths; update):
|
|
17
|
+
reduce path(paths) as $p ([., []];
|
|
18
|
+
. as $dot
|
|
19
|
+
| null
|
|
20
|
+
| label $out
|
|
21
|
+
| ($dot[0] | getpath($p)) as $v
|
|
22
|
+
| (
|
|
23
|
+
( $$$$v
|
|
24
|
+
| update
|
|
25
|
+
| (., break $out) as $v
|
|
26
|
+
| $$$$dot
|
|
27
|
+
| setpath([0] + $p; $v)
|
|
28
|
+
),
|
|
29
|
+
(
|
|
30
|
+
$$$$dot
|
|
31
|
+
| setpath([1, (.[1] | length)]; $p)
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
) | . as $dot | $dot[0] | delpaths($dot[1]);
|
|
15
35
|
def map_values(f): .[] |= f;
|
|
16
36
|
|
|
17
37
|
# recurse
|
|
18
38
|
def recurse(f): def r: ., (f | r); r;
|
|
19
39
|
def recurse(f; cond): def r: ., (f | select(cond) | r); r;
|
|
20
40
|
def recurse: recurse(.[]?);
|
|
21
|
-
def recurse_down: recurse;
|
|
22
41
|
|
|
23
42
|
def to_entries: [keys_unsorted[] as $k | {key: $k, value: .[$k]}];
|
|
24
43
|
def from_entries: map({(.key // .Key // .name // .Name): (if has("value") then .value else .Value end)}) | add | .//={};
|
|
@@ -30,36 +49,20 @@ def indices($i): if type == "array" and ($i|type) == "array" then .[$i]
|
|
|
30
49
|
else .[$i] end;
|
|
31
50
|
def index($i): indices($i) | .[0]; # TODO: optimize
|
|
32
51
|
def rindex($i): indices($i) | .[-1:][0]; # TODO: optimize
|
|
33
|
-
def paths: path(recurse
|
|
34
|
-
def paths(node_filter):
|
|
35
|
-
def any(generator; condition):
|
|
36
|
-
[label $out | foreach generator as $i
|
|
37
|
-
(false;
|
|
38
|
-
if . then break $out elif $i | condition then true else . end;
|
|
39
|
-
if . then . else empty end)] | length == 1;
|
|
40
|
-
def any(condition): any(.[]; condition);
|
|
41
|
-
def any: any(.);
|
|
42
|
-
def all(generator; condition):
|
|
43
|
-
[label $out | foreach generator as $i
|
|
44
|
-
(true;
|
|
45
|
-
if .|not then break $out elif $i | condition then . else false end;
|
|
46
|
-
if .|not then . else empty end)] | length == 0;
|
|
47
|
-
def all(condition): all(.[]; condition);
|
|
48
|
-
def all: all(.);
|
|
52
|
+
def paths: path(recurse)|select(length > 0);
|
|
53
|
+
def paths(node_filter): path(recurse|select(node_filter))|select(length > 0);
|
|
49
54
|
def isfinite: type == "number" and (isinfinite | not);
|
|
50
55
|
def arrays: select(type == "array");
|
|
51
56
|
def objects: select(type == "object");
|
|
52
|
-
def iterables:
|
|
57
|
+
def iterables: select(type|. == "array" or . == "object");
|
|
53
58
|
def booleans: select(type == "boolean");
|
|
54
59
|
def numbers: select(type == "number");
|
|
55
60
|
def normals: select(isnormal);
|
|
56
61
|
def finites: select(isfinite);
|
|
57
62
|
def strings: select(type == "string");
|
|
58
|
-
def nulls: select(
|
|
63
|
+
def nulls: select(. == null);
|
|
59
64
|
def values: select(. != null);
|
|
60
|
-
def scalars: select(
|
|
61
|
-
def scalars_or_empty: select(. == null or . == true or . == false or type == "number" or type == "string" or ((type=="array" or type=="object") and length==0));
|
|
62
|
-
def leaf_paths: paths(scalars);
|
|
65
|
+
def scalars: select(type|. != "array" and . != "object");
|
|
63
66
|
def join($x): reduce .[] as $i (null;
|
|
64
67
|
(if .==null then "" else .+$x end) +
|
|
65
68
|
($i | if type=="boolean" or type=="number" then tostring else .//"" end)
|
|
@@ -72,6 +75,8 @@ def fromdateiso8601: strptime("%Y-%m-%dT%H:%M:%SZ")|mktime;
|
|
|
72
75
|
def todateiso8601: strftime("%Y-%m-%dT%H:%M:%SZ");
|
|
73
76
|
def fromdate: fromdateiso8601;
|
|
74
77
|
def todate: todateiso8601;
|
|
78
|
+
def ltrimstr($left): if startswith($left) then .[$left | length:] end;
|
|
79
|
+
def rtrimstr($right): if endswith($right) then .[:$right | -length] end;
|
|
75
80
|
def match(re; mode): _match_impl(re; mode; false)|.[];
|
|
76
81
|
def match($val): ($val|type) as $vt | if $vt == "string" then match($val; null)
|
|
77
82
|
elif $vt == "array" and ($val | length) > 1 then match($val[0]; $val[1])
|
|
@@ -87,17 +92,20 @@ def capture($val): ($val|type) as $vt | if $vt == "string" then capture($val; nu
|
|
|
87
92
|
elif $vt == "array" and ($val | length) > 1 then capture($val[0]; $val[1])
|
|
88
93
|
elif $vt == "array" and ($val | length) > 0 then capture($val[0]; null)
|
|
89
94
|
else error( $vt + " not a string or array") end;
|
|
90
|
-
def scan(re):
|
|
91
|
-
match(re; "g")
|
|
92
|
-
|
|
95
|
+
def scan($re; $flags):
|
|
96
|
+
match($re; "g" + $flags)
|
|
97
|
+
| if (.captures|length > 0)
|
|
93
98
|
then [ .captures | .[] | .string ]
|
|
94
99
|
else .string
|
|
95
|
-
end
|
|
100
|
+
end;
|
|
101
|
+
def scan($re): scan($re; null);
|
|
96
102
|
#
|
|
97
103
|
# If input is an array, then emit a stream of successive subarrays of length n (or less),
|
|
98
104
|
# and similarly for strings.
|
|
99
|
-
def _nwise(
|
|
100
|
-
def
|
|
105
|
+
def _nwise($n):
|
|
106
|
+
def n: if length <= $n then . else .[0:$n] , (.[$n:] | n) end;
|
|
107
|
+
n;
|
|
108
|
+
def _nwise(a; $n): a | _nwise($n);
|
|
101
109
|
#
|
|
102
110
|
# splits/1 produces a stream; split/1 is retained for backward compatibility.
|
|
103
111
|
def splits($re; flags): . as $s
|
|
@@ -111,53 +119,27 @@ def splits($re): splits($re; null);
|
|
|
111
119
|
# split emits an array for backward compatibility
|
|
112
120
|
def split($re; flags): [ splits($re; flags) ];
|
|
113
121
|
#
|
|
114
|
-
# If s contains capture variables, then create a capture object and pipe it to s
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
#
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def sub($re; s; flags):
|
|
129
|
-
def subg: [explode[] | select(. != 103)] | implode;
|
|
130
|
-
# "fla" should be flags with all occurrences of g removed; gs should be non-nil if flags has a g
|
|
131
|
-
def sub1(fla; gs):
|
|
132
|
-
def mysub:
|
|
133
|
-
. as $in
|
|
134
|
-
| [match($re; fla)]
|
|
135
|
-
| if length == 0 then $in
|
|
136
|
-
else .[0] as $edit
|
|
137
|
-
| ($edit | .offset + .length) as $len
|
|
138
|
-
# create the "capture" object:
|
|
139
|
-
| reduce ( $edit | .captures | .[] | select(.name != null) | { (.name) : .string } ) as $pair
|
|
140
|
-
({}; . + $pair)
|
|
141
|
-
| $in[0:$edit.offset]
|
|
142
|
-
+ s
|
|
143
|
-
+ ($in[$len:] | if length > 0 and gs then mysub else . end)
|
|
144
|
-
end ;
|
|
145
|
-
mysub ;
|
|
146
|
-
(flags | index("g")) as $gs
|
|
147
|
-
| (flags | if $gs then subg else . end) as $fla
|
|
148
|
-
| sub1($fla; $gs);
|
|
122
|
+
# If s contains capture variables, then create a capture object and pipe it to s, bearing
|
|
123
|
+
# in mind that s could be a stream
|
|
124
|
+
def sub($re; s; $flags):
|
|
125
|
+
. as $in
|
|
126
|
+
| (reduce match($re; $flags) as $edit
|
|
127
|
+
({result: [], previous: 0};
|
|
128
|
+
$in[ .previous: ($edit | .offset) ] as $gap
|
|
129
|
+
# create the "capture" objects (one per item in s)
|
|
130
|
+
| [reduce ( $edit | .captures | .[] | select(.name != null) | { (.name) : .string } ) as $pair
|
|
131
|
+
({}; . + $pair) | s ] as $inserts
|
|
132
|
+
| reduce range(0; $inserts|length) as $ix (.; .result[$ix] += $gap + $inserts[$ix])
|
|
133
|
+
| .previous = ($edit | .offset + .length ) )
|
|
134
|
+
| .result[] + $in[.previous:] )
|
|
135
|
+
// $in;
|
|
149
136
|
#
|
|
150
137
|
def sub($re; s): sub($re; s; "");
|
|
151
|
-
#
|
|
138
|
+
#
|
|
152
139
|
def gsub($re; s; flags): sub($re; s; flags + "g");
|
|
153
140
|
def gsub($re; s): sub($re; s; "g");
|
|
154
|
-
|
|
141
|
+
#
|
|
155
142
|
########################################################################
|
|
156
|
-
# range/3, with a `by` expression argument
|
|
157
|
-
def range($init; $upto; $by):
|
|
158
|
-
def _range:
|
|
159
|
-
if ($by > 0 and . < $upto) or ($by < 0 and . > $upto) then ., ((.+$by)|_range) else . end;
|
|
160
|
-
if $by == 0 then $init else $init|_range end | select(($by > 0 and . < $upto) or ($by < 0 and . > $upto));
|
|
161
143
|
# generic iterator/generator
|
|
162
144
|
def while(cond; update):
|
|
163
145
|
def _while:
|
|
@@ -167,14 +149,30 @@ def until(cond; next):
|
|
|
167
149
|
def _until:
|
|
168
150
|
if cond then . else (next|_until) end;
|
|
169
151
|
_until;
|
|
170
|
-
def limit($n;
|
|
171
|
-
if $n
|
|
172
|
-
|
|
173
|
-
end;
|
|
174
|
-
def
|
|
152
|
+
def limit($n; expr):
|
|
153
|
+
if $n > 0 then label $out | foreach expr as $item ($n; . - 1; $item, if . <= 0 then break $out else empty end)
|
|
154
|
+
elif $n == 0 then empty
|
|
155
|
+
else error("limit doesn't support negative count") end;
|
|
156
|
+
def skip($n; expr):
|
|
157
|
+
if $n > 0 then foreach expr as $item ($n; . - 1; if . < 0 then $item else empty end)
|
|
158
|
+
elif $n == 0 then expr
|
|
159
|
+
else error("skip doesn't support negative count") end;
|
|
160
|
+
# range/3, with a `by` expression argument
|
|
161
|
+
def range($init; $upto; $by):
|
|
162
|
+
if $by > 0 then $init|while(. < $upto; . + $by)
|
|
163
|
+
elif $by < 0 then $init|while(. > $upto; . + $by)
|
|
164
|
+
else empty end;
|
|
175
165
|
def first(g): label $out | g | ., break $out;
|
|
176
|
-
def
|
|
177
|
-
def
|
|
166
|
+
def isempty(g): first((g|false), true);
|
|
167
|
+
def all(generator; condition): isempty(generator|condition and empty);
|
|
168
|
+
def any(generator; condition): isempty(generator|condition or empty)|not;
|
|
169
|
+
def all(condition): all(.[]; condition);
|
|
170
|
+
def any(condition): any(.[]; condition);
|
|
171
|
+
def all: all(.[]; .);
|
|
172
|
+
def any: any(.[]; .);
|
|
173
|
+
def nth($n; g):
|
|
174
|
+
if $n < 0 then error("nth doesn't support negative indices")
|
|
175
|
+
else first(skip($n; g)) end;
|
|
178
176
|
def first: .[0];
|
|
179
177
|
def last: .[-1];
|
|
180
178
|
def nth($n): .[$n];
|
|
@@ -190,22 +188,14 @@ def combinations(n):
|
|
|
190
188
|
| combinations;
|
|
191
189
|
# transpose a possibly jagged matrix, quickly;
|
|
192
190
|
# rows are padded with nulls so the result is always rectangular.
|
|
193
|
-
def transpose:
|
|
194
|
-
if . == [] then []
|
|
195
|
-
else . as $in
|
|
196
|
-
| (map(length) | max) as $max
|
|
197
|
-
| length as $length
|
|
198
|
-
| reduce range(0; $max) as $j
|
|
199
|
-
([]; . + [reduce range(0;$length) as $i ([]; . + [ $in[$i][$j] ] )] )
|
|
200
|
-
end;
|
|
191
|
+
def transpose: [range(0; map(length)|max // 0) as $i | [.[][$i]]];
|
|
201
192
|
def in(xs): . as $x | xs | has($x);
|
|
202
193
|
def inside(xs): . as $x | xs | contains($x);
|
|
203
|
-
def input: _input;
|
|
204
194
|
def repeat(exp):
|
|
205
195
|
def _repeat:
|
|
206
196
|
exp, _repeat;
|
|
207
197
|
_repeat;
|
|
208
|
-
def inputs: try repeat(
|
|
198
|
+
def inputs: try repeat(input) catch if .=="break" then empty else error end;
|
|
209
199
|
# like ruby's downcase - only characters A to Z are affected
|
|
210
200
|
def ascii_downcase:
|
|
211
201
|
explode | map( if 65 <= . and . <= 90 then . + 32 else . end) | implode;
|
|
@@ -216,50 +206,27 @@ def ascii_upcase:
|
|
|
216
206
|
# Streaming utilities
|
|
217
207
|
def truncate_stream(stream):
|
|
218
208
|
. as $n | null | stream | . as $input | if (.[0]|length) > $n then setpath([0];$input[0][$n:]) else empty end;
|
|
219
|
-
def fromstream(i):
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
[.[0]|setpath(($item|.[0]); ($item|.[1])),
|
|
228
|
-
true,
|
|
229
|
-
$state[2],
|
|
230
|
-
$state[3]]
|
|
231
|
-
else .
|
|
232
|
-
end;
|
|
233
|
-
if ($item[0]|length) == 1 and ($item|length == 1) and .[3] then .[2] else empty end,
|
|
234
|
-
if ($item[0]|length) == 0 then $item[1] else empty end
|
|
235
|
-
);
|
|
209
|
+
def fromstream(i): {x: null, e: false} as $init |
|
|
210
|
+
# .x = object being built; .e = emit and reset state
|
|
211
|
+
foreach i as $i ($init
|
|
212
|
+
; if .e then $init else . end
|
|
213
|
+
| if $i|length == 2
|
|
214
|
+
then setpath(["e"]; $i[0]|length==0) | setpath(["x"]+$i[0]; $i[1])
|
|
215
|
+
else setpath(["e"]; $i[0]|length==1) end
|
|
216
|
+
; if .e then .x else empty end);
|
|
236
217
|
def tostream:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
else
|
|
241
|
-
# We really need a _streaming_ form of `keys`.
|
|
242
|
-
# We can use `range` for arrays, but not for objects.
|
|
243
|
-
keys_unsorted as $keys |
|
|
244
|
-
$keys[-1] as $last|
|
|
245
|
-
((# for each key
|
|
246
|
-
$keys[] | . as $key |
|
|
247
|
-
$dot[$key] | . as $dot |
|
|
248
|
-
# recurse on each key/value
|
|
249
|
-
tostream|.[0]|=[$key]+.),
|
|
250
|
-
# then add the closing marker
|
|
251
|
-
[[$last]])
|
|
252
|
-
end;
|
|
253
|
-
|
|
218
|
+
path(def r: (.[]?|r), .; r) as $p |
|
|
219
|
+
getpath($p) |
|
|
220
|
+
reduce path(.[]?) as $q ([$p, .]; [$p+$q]);
|
|
254
221
|
|
|
255
222
|
# Assuming the input array is sorted, bsearch/1 returns
|
|
256
223
|
# the index of the target if the target is in the input array; and otherwise
|
|
257
224
|
# (-1 - ix), where ix is the insertion point that would leave the array sorted.
|
|
258
225
|
# If the input is not sorted, bsearch will terminate but with irrelevant results.
|
|
259
|
-
def bsearch(target):
|
|
226
|
+
def bsearch($target):
|
|
260
227
|
if length == 0 then -1
|
|
261
228
|
elif length == 1 then
|
|
262
|
-
if target == .[0] then 0 elif target < .[0] then -1 else -2 end
|
|
229
|
+
if $target == .[0] then 0 elif $target < .[0] then -1 else -2 end
|
|
263
230
|
else . as $in
|
|
264
231
|
# state variable: [start, end, answer]
|
|
265
232
|
# where start and end are the upper and lower offsets to use.
|
|
@@ -269,14 +236,14 @@ def bsearch(target):
|
|
|
269
236
|
else
|
|
270
237
|
( ( (.[1] + .[0]) / 2 ) | floor ) as $mid
|
|
271
238
|
| $in[$mid] as $monkey
|
|
272
|
-
| if $monkey == target then (.[2] = $mid) # success
|
|
239
|
+
| if $monkey == $target then (.[2] = $mid) # success
|
|
273
240
|
elif .[0] == .[1] then (.[1] = -1) # failure
|
|
274
|
-
elif $monkey < target then (.[0] = ($mid + 1))
|
|
241
|
+
elif $monkey < $target then (.[0] = ($mid + 1))
|
|
275
242
|
else (.[1] = ($mid - 1))
|
|
276
243
|
end
|
|
277
244
|
end )
|
|
278
245
|
| if .[2] == null then # compute the insertion point
|
|
279
|
-
if $in[ .[0] ] < target then (-2 -.[0])
|
|
246
|
+
if $in[ .[0] ] < $target then (-2 -.[0])
|
|
280
247
|
else (-1 -.[0])
|
|
281
248
|
end
|
|
282
249
|
else .[2]
|
|
@@ -285,21 +252,27 @@ def bsearch(target):
|
|
|
285
252
|
|
|
286
253
|
# Apply f to composite entities recursively, and to atoms
|
|
287
254
|
def walk(f):
|
|
255
|
+
def w:
|
|
256
|
+
if type == "object"
|
|
257
|
+
then map_values(w)
|
|
258
|
+
elif type == "array" then map(w)
|
|
259
|
+
else .
|
|
260
|
+
end
|
|
261
|
+
| f;
|
|
262
|
+
w;
|
|
263
|
+
|
|
264
|
+
# pathexps could be a stream of dot-paths
|
|
265
|
+
def pick(pathexps):
|
|
288
266
|
. as $in
|
|
289
|
-
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
end;
|
|
267
|
+
| reduce path(pathexps) as $a (null;
|
|
268
|
+
setpath($a; $in|getpath($a)) );
|
|
269
|
+
|
|
270
|
+
# ensure the output of debug(m1,m2) is kept together:
|
|
271
|
+
def debug(msgs): (msgs | debug | empty), .;
|
|
295
272
|
|
|
296
273
|
# SQL-ish operators here:
|
|
297
274
|
def INDEX(stream; idx_expr):
|
|
298
|
-
reduce stream as $row ({};
|
|
299
|
-
.[$row|idx_expr|
|
|
300
|
-
if type != "string" then tojson
|
|
301
|
-
else .
|
|
302
|
-
end] |= $row);
|
|
275
|
+
reduce stream as $row ({}; .[$row|idx_expr|tostring] = $row);
|
|
303
276
|
def INDEX(idx_expr): INDEX(.[]; idx_expr);
|
|
304
277
|
def JOIN($idx; idx_expr):
|
|
305
278
|
[.[] | [., $idx[idx_expr]]];
|
|
@@ -307,5 +280,5 @@ def JOIN($idx; stream; idx_expr):
|
|
|
307
280
|
stream | [., $idx[idx_expr]];
|
|
308
281
|
def JOIN($idx; stream; idx_expr; join_expr):
|
|
309
282
|
stream | [., $idx[idx_expr]] | join_expr;
|
|
310
|
-
def IN(s):
|
|
311
|
-
def IN(src; s):
|
|
283
|
+
def IN(s): any(s == .; .);
|
|
284
|
+
def IN(src; s): any(src == s; .);
|
package/deps/jq/src/bytecode.h
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#define BYTECODE_H
|
|
3
3
|
#include <stdint.h>
|
|
4
4
|
|
|
5
|
-
#include "
|
|
5
|
+
#include "jq.h"
|
|
6
6
|
|
|
7
7
|
typedef enum {
|
|
8
8
|
#define OP(name, imm, in, out) name,
|
|
@@ -44,10 +44,14 @@ struct opcode_description {
|
|
|
44
44
|
const struct opcode_description* opcode_describe(opcode op);
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
#define MAX_CFUNCTION_ARGS
|
|
48
|
-
typedef void (*cfunction_ptr)();
|
|
47
|
+
#define MAX_CFUNCTION_ARGS 4
|
|
49
48
|
struct cfunction {
|
|
50
|
-
|
|
49
|
+
union {
|
|
50
|
+
jv (*a1)(jq_state *, jv);
|
|
51
|
+
jv (*a2)(jq_state *, jv, jv);
|
|
52
|
+
jv (*a3)(jq_state *, jv, jv, jv);
|
|
53
|
+
jv (*a4)(jq_state *, jv, jv, jv, jv);
|
|
54
|
+
} fptr;
|
|
51
55
|
const char* name;
|
|
52
56
|
int nargs;
|
|
53
57
|
};
|