@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.
Files changed (352) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/configure +6 -5
  3. package/deps/jq/.claude/settings.local.json +7 -0
  4. package/deps/jq/.gitattributes +1 -3
  5. package/deps/jq/AUTHORS +55 -1
  6. package/deps/jq/COPYING +40 -0
  7. package/deps/jq/Makefile.am +40 -36
  8. package/deps/jq/NEWS.md +277 -2
  9. package/deps/jq/README.md +23 -5
  10. package/deps/jq/compile-ios.sh +1 -1
  11. package/deps/jq/config/m4/check-math-func.m4 +2 -2
  12. package/deps/jq/config/m4/find-func-no-libs2.m4 +3 -3
  13. package/deps/jq/configure.ac +10 -18
  14. package/deps/jq/docs/Pipfile.lock +368 -313
  15. package/deps/jq/docs/README.md +3 -4
  16. package/deps/jq/docs/build_manpage.py +1 -1
  17. package/deps/jq/docs/build_mantests.py +1 -1
  18. package/deps/jq/docs/build_website.py +1 -8
  19. package/deps/jq/docs/content/download/default.yml +49 -9
  20. package/deps/jq/docs/content/index.yml +9 -0
  21. package/deps/jq/docs/content/manual/{manual.yml → dev/manual.yml} +218 -61
  22. package/deps/jq/docs/content/manual/v1.3/manual.yml +0 -5
  23. package/deps/jq/docs/content/manual/v1.4/manual.yml +0 -5
  24. package/deps/jq/docs/content/manual/v1.5/manual.yml +3 -8
  25. package/deps/jq/docs/content/manual/v1.6/manual.yml +3 -8
  26. package/deps/jq/docs/content/manual/v1.7/manual.yml +499 -500
  27. package/deps/jq/docs/content/manual/v1.8/manual.yml +3858 -0
  28. package/deps/jq/docs/content/tutorial/default.yml +3 -3
  29. package/deps/jq/docs/manual_schema.yml +0 -3
  30. package/deps/jq/docs/public/CNAME +1 -0
  31. package/deps/jq/docs/templates/index.html.j2 +10 -10
  32. package/deps/jq/docs/templates/manual.html.j2 +14 -3
  33. package/deps/jq/docs/templates/shared/_head.html.j2 +8 -3
  34. package/deps/jq/docs/templates/shared/_navbar.html.j2 +4 -4
  35. package/deps/jq/jq.1.prebuilt +219 -44
  36. package/deps/jq/jq.spec +2 -2
  37. package/deps/jq/libjq.pc.in +1 -1
  38. package/deps/jq/scripts/version +1 -1
  39. package/deps/jq/sig/v1.7.1/jq-1.7.1.tar.gz.asc +16 -0
  40. package/deps/jq/sig/v1.7.1/jq-1.7.1.zip.asc +16 -0
  41. package/deps/jq/sig/v1.7.1/jq-linux-amd64.asc +16 -0
  42. package/deps/jq/sig/v1.7.1/jq-linux-arm64.asc +16 -0
  43. package/deps/jq/sig/v1.7.1/jq-linux-armel.asc +16 -0
  44. package/deps/jq/sig/v1.7.1/jq-linux-armhf.asc +16 -0
  45. package/deps/jq/sig/v1.7.1/jq-linux-i386.asc +16 -0
  46. package/deps/jq/sig/v1.7.1/jq-linux-mips.asc +16 -0
  47. package/deps/jq/sig/v1.7.1/jq-linux-mips64.asc +16 -0
  48. package/deps/jq/sig/v1.7.1/jq-linux-mips64el.asc +16 -0
  49. package/deps/jq/sig/v1.7.1/jq-linux-mips64r6.asc +16 -0
  50. package/deps/jq/sig/v1.7.1/jq-linux-mips64r6el.asc +16 -0
  51. package/deps/jq/sig/v1.7.1/jq-linux-mipsel.asc +16 -0
  52. package/deps/jq/sig/v1.7.1/jq-linux-mipsr6.asc +16 -0
  53. package/deps/jq/sig/v1.7.1/jq-linux-mipsr6el.asc +16 -0
  54. package/deps/jq/sig/v1.7.1/jq-linux-powerpc.asc +16 -0
  55. package/deps/jq/sig/v1.7.1/jq-linux-ppc64el.asc +16 -0
  56. package/deps/jq/sig/v1.7.1/jq-linux-riscv64.asc +16 -0
  57. package/deps/jq/sig/v1.7.1/jq-linux-s390x.asc +16 -0
  58. package/deps/jq/sig/v1.7.1/jq-linux64.asc +16 -0
  59. package/deps/jq/sig/v1.7.1/jq-macos-amd64.asc +16 -0
  60. package/deps/jq/sig/v1.7.1/jq-macos-arm64.asc +16 -0
  61. package/deps/jq/sig/v1.7.1/jq-osx-amd64.asc +16 -0
  62. package/deps/jq/sig/v1.7.1/jq-win64.exe.asc +16 -0
  63. package/deps/jq/sig/v1.7.1/jq-windows-amd64.exe.asc +16 -0
  64. package/deps/jq/sig/v1.7.1/jq-windows-i386.exe.asc +16 -0
  65. package/deps/jq/sig/v1.7.1/sha256sum.txt +26 -0
  66. package/deps/jq/sig/v1.8.0/jq-1.8.0.tar.gz.asc +16 -0
  67. package/deps/jq/sig/v1.8.0/jq-1.8.0.zip.asc +16 -0
  68. package/deps/jq/sig/v1.8.0/jq-linux-amd64.asc +16 -0
  69. package/deps/jq/sig/v1.8.0/jq-linux-arm64.asc +16 -0
  70. package/deps/jq/sig/v1.8.0/jq-linux-armel.asc +16 -0
  71. package/deps/jq/sig/v1.8.0/jq-linux-armhf.asc +16 -0
  72. package/deps/jq/sig/v1.8.0/jq-linux-i386.asc +16 -0
  73. package/deps/jq/sig/v1.8.0/jq-linux-mips.asc +16 -0
  74. package/deps/jq/sig/v1.8.0/jq-linux-mips64.asc +16 -0
  75. package/deps/jq/sig/v1.8.0/jq-linux-mips64el.asc +16 -0
  76. package/deps/jq/sig/v1.8.0/jq-linux-mips64r6.asc +16 -0
  77. package/deps/jq/sig/v1.8.0/jq-linux-mips64r6el.asc +16 -0
  78. package/deps/jq/sig/v1.8.0/jq-linux-mipsel.asc +16 -0
  79. package/deps/jq/sig/v1.8.0/jq-linux-mipsr6.asc +16 -0
  80. package/deps/jq/sig/v1.8.0/jq-linux-mipsr6el.asc +16 -0
  81. package/deps/jq/sig/v1.8.0/jq-linux-powerpc.asc +16 -0
  82. package/deps/jq/sig/v1.8.0/jq-linux-ppc64el.asc +16 -0
  83. package/deps/jq/sig/v1.8.0/jq-linux-riscv64.asc +16 -0
  84. package/deps/jq/sig/v1.8.0/jq-linux-s390x.asc +16 -0
  85. package/deps/jq/sig/v1.8.0/jq-linux64.asc +16 -0
  86. package/deps/jq/sig/v1.8.0/jq-macos-amd64.asc +16 -0
  87. package/deps/jq/sig/v1.8.0/jq-macos-arm64.asc +16 -0
  88. package/deps/jq/sig/v1.8.0/jq-osx-amd64.asc +16 -0
  89. package/deps/jq/sig/v1.8.0/jq-win64.exe.asc +16 -0
  90. package/deps/jq/sig/v1.8.0/jq-windows-amd64.exe.asc +16 -0
  91. package/deps/jq/sig/v1.8.0/jq-windows-i386.exe.asc +16 -0
  92. package/deps/jq/sig/v1.8.0/sha256sum.txt +26 -0
  93. package/deps/jq/src/builtin.c +446 -271
  94. package/deps/jq/src/builtin.jq +25 -60
  95. package/deps/jq/src/bytecode.h +8 -3
  96. package/deps/jq/src/compile.c +22 -43
  97. package/deps/jq/src/compile.h +1 -1
  98. package/deps/jq/src/execute.c +20 -25
  99. package/deps/jq/src/jq_test.c +113 -44
  100. package/deps/jq/src/jv.c +134 -42
  101. package/deps/jq/src/jv.h +10 -3
  102. package/deps/jq/src/jv_alloc.c +8 -5
  103. package/deps/jq/src/jv_alloc.h +0 -1
  104. package/deps/jq/src/jv_aux.c +41 -8
  105. package/deps/jq/src/jv_dtoa.c +4 -12
  106. package/deps/jq/src/jv_dtoa_tsd.c +5 -4
  107. package/deps/jq/src/jv_dtoa_tsd.h +1 -1
  108. package/deps/jq/src/jv_parse.c +5 -3
  109. package/deps/jq/src/jv_print.c +87 -65
  110. package/deps/jq/src/jv_unicode.c +18 -0
  111. package/deps/jq/src/jv_unicode.h +2 -0
  112. package/deps/jq/src/lexer.c +303 -278
  113. package/deps/jq/src/lexer.h +5 -4
  114. package/deps/jq/src/lexer.l +8 -2
  115. package/deps/jq/src/libm.h +15 -5
  116. package/deps/jq/src/linker.c +6 -4
  117. package/deps/jq/src/locfile.c +12 -12
  118. package/deps/jq/src/main.c +204 -270
  119. package/deps/jq/src/parser.c +1105 -1273
  120. package/deps/jq/src/parser.y +149 -181
  121. package/deps/jq/src/util.c +46 -48
  122. package/deps/jq/src/util.h +1 -1
  123. package/deps/jq/tests/base64.test +12 -0
  124. package/deps/jq/tests/jq.test +429 -37
  125. package/deps/jq/tests/jq_fuzz_load_file.c +1 -0
  126. package/deps/jq/tests/man.test +46 -13
  127. package/deps/jq/tests/manonig.test +13 -0
  128. package/deps/jq/tests/onig.test +40 -2
  129. package/deps/jq/tests/optional.test +4 -12
  130. package/deps/jq/tests/setup +5 -1
  131. package/deps/jq/tests/shtest +358 -130
  132. package/deps/jq/tests/uri.test +38 -0
  133. package/deps/jq/tests/uritest +5 -0
  134. package/deps/jq/{src → vendor}/decNumber/decBasic.c +1 -1
  135. package/deps/jq/{src → vendor}/decNumber/decCommon.c +1 -1
  136. package/deps/jq/{src → vendor}/decNumber/decNumber.c +4 -4
  137. package/deps/jq/{modules → vendor}/oniguruma/CMakeLists.txt +5 -3
  138. package/deps/jq/{modules → vendor}/oniguruma/HISTORY +45 -7
  139. package/deps/jq/{modules → vendor}/oniguruma/Makefile.am +1 -1
  140. package/deps/jq/{modules → vendor}/oniguruma/README.md +10 -23
  141. package/deps/jq/{modules → vendor}/oniguruma/compile +29 -13
  142. package/deps/jq/{modules → vendor}/oniguruma/config.guess +91 -27
  143. package/deps/jq/{modules → vendor}/oniguruma/config.sub +716 -242
  144. package/deps/jq/{modules → vendor}/oniguruma/configure.ac +2 -2
  145. package/deps/jq/{modules → vendor}/oniguruma/depcomp +10 -9
  146. package/deps/jq/{modules → vendor}/oniguruma/doc/API +3 -1
  147. package/deps/jq/{modules → vendor}/oniguruma/doc/API.ja +3 -1
  148. package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.BUILTIN +10 -1
  149. package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.BUILTIN.ja +9 -1
  150. package/deps/jq/{modules → vendor}/oniguruma/doc/RE +12 -13
  151. package/deps/jq/{modules → vendor}/oniguruma/doc/RE.ja +12 -13
  152. package/deps/jq/{modules → vendor}/oniguruma/doc/SYNTAX.md +202 -167
  153. package/deps/jq/{modules → vendor}/oniguruma/doc/UNICODE_PROPERTIES +33 -1
  154. package/deps/jq/vendor/oniguruma/doc/onig_syn_md.c +667 -0
  155. package/deps/jq/{modules → vendor}/oniguruma/harnesses/base.c +1 -1
  156. package/deps/jq/{modules → vendor}/oniguruma/install-sh +9 -9
  157. package/deps/jq/{modules → vendor}/oniguruma/missing +50 -29
  158. package/deps/jq/{modules → vendor}/oniguruma/sample/callback_each_match.c +1 -3
  159. package/deps/jq/vendor/oniguruma/sbom.cdx.json +44 -0
  160. package/deps/jq/{modules → vendor}/oniguruma/src/ascii.c +4 -1
  161. package/deps/jq/{modules → vendor}/oniguruma/src/gperf_fold_key_conv.py +4 -4
  162. package/deps/jq/{modules → vendor}/oniguruma/src/gperf_unfold_key_conv.py +4 -4
  163. package/deps/jq/vendor/oniguruma/src/make_unicode_egcb.sh +7 -0
  164. package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_egcb_data.py +20 -19
  165. package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_fold.sh +5 -5
  166. package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_fold_data.py +37 -37
  167. package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_property.sh +2 -2
  168. package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_property_data.py +66 -65
  169. package/deps/jq/vendor/oniguruma/src/make_unicode_wb.sh +7 -0
  170. package/deps/jq/{modules → vendor}/oniguruma/src/make_unicode_wb_data.py +20 -19
  171. package/deps/jq/{modules → vendor}/oniguruma/src/oniguruma.h +6 -3
  172. package/deps/jq/{modules → vendor}/oniguruma/src/regcomp.c +14 -6
  173. package/deps/jq/{modules → vendor}/oniguruma/src/regerror.c +2 -2
  174. package/deps/jq/{modules → vendor}/oniguruma/src/regexec.c +85 -14
  175. package/deps/jq/{modules → vendor}/oniguruma/src/regint.h +17 -4
  176. package/deps/jq/{modules → vendor}/oniguruma/src/regparse.c +115 -27
  177. package/deps/jq/{modules → vendor}/oniguruma/src/regsyntax.c +10 -7
  178. package/deps/jq/{modules → vendor}/oniguruma/src/st.c +49 -75
  179. package/deps/jq/{modules → vendor}/oniguruma/src/st.h +3 -10
  180. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_egcb_data.c +54 -49
  181. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_fold1_key.c +1567 -1507
  182. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_fold2_key.c +1 -1
  183. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_fold3_key.c +1 -1
  184. package/deps/jq/vendor/oniguruma/src/unicode_fold_data.c +1619 -0
  185. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_property_data.c +5520 -4178
  186. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_property_data_posix.c +239 -83
  187. package/deps/jq/vendor/oniguruma/src/unicode_unfold_key.c +3497 -0
  188. package/deps/jq/{modules → vendor}/oniguruma/src/unicode_wb_data.c +51 -19
  189. package/deps/jq/{modules → vendor}/oniguruma/src/utf16_be.c +3 -2
  190. package/deps/jq/{modules → vendor}/oniguruma/src/utf16_le.c +3 -2
  191. package/deps/jq/{modules → vendor}/oniguruma/test/test_back.c +3 -3
  192. package/deps/jq/{modules → vendor}/oniguruma/test/test_options.c +2 -2
  193. package/deps/jq/{modules → vendor}/oniguruma/test/test_syntax.c +54 -2
  194. package/deps/jq/{modules → vendor}/oniguruma/test/test_utf8.c +19 -5
  195. package/deps/jq/{modules → vendor}/oniguruma/test/testc.c +1 -1
  196. package/deps/jq/{modules → vendor}/oniguruma/test/testp.c +1 -1
  197. package/deps/jq/{modules → vendor}/oniguruma/test-driver +13 -6
  198. package/deps/jq/{modules → vendor}/oniguruma/windows/CMakeLists.txt +1 -1
  199. package/index.d.ts +2 -1
  200. package/lib/index.js +1 -0
  201. package/lib/jq.js +2 -1
  202. package/package.json +4 -3
  203. package/test/santiy-async.test.js +4 -4
  204. package/test/santiy.test.js +4 -4
  205. package/test/template.test.js +6 -6
  206. package/deps/jq/modules/oniguruma/src/make_unicode_egcb.sh +0 -7
  207. package/deps/jq/modules/oniguruma/src/make_unicode_wb.sh +0 -7
  208. package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +0 -1592
  209. package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +0 -3394
  210. package/deps/jq/scripts/update-website +0 -30
  211. /package/deps/jq/{src → vendor}/decNumber/ICU-license.html +0 -0
  212. /package/deps/jq/{src → vendor}/decNumber/decContext.c +0 -0
  213. /package/deps/jq/{src → vendor}/decNumber/decContext.h +0 -0
  214. /package/deps/jq/{src → vendor}/decNumber/decDPD.h +0 -0
  215. /package/deps/jq/{src → vendor}/decNumber/decDouble.c +0 -0
  216. /package/deps/jq/{src → vendor}/decNumber/decDouble.h +0 -0
  217. /package/deps/jq/{src → vendor}/decNumber/decNumber.h +0 -0
  218. /package/deps/jq/{src → vendor}/decNumber/decNumberLocal.h +0 -0
  219. /package/deps/jq/{src → vendor}/decNumber/decPacked.c +0 -0
  220. /package/deps/jq/{src → vendor}/decNumber/decPacked.h +0 -0
  221. /package/deps/jq/{src → vendor}/decNumber/decQuad.c +0 -0
  222. /package/deps/jq/{src → vendor}/decNumber/decQuad.h +0 -0
  223. /package/deps/jq/{src → vendor}/decNumber/decSingle.c +0 -0
  224. /package/deps/jq/{src → vendor}/decNumber/decSingle.h +0 -0
  225. /package/deps/jq/{src → vendor}/decNumber/decimal128.c +0 -0
  226. /package/deps/jq/{src → vendor}/decNumber/decimal128.h +0 -0
  227. /package/deps/jq/{src → vendor}/decNumber/decimal32.c +0 -0
  228. /package/deps/jq/{src → vendor}/decNumber/decimal32.h +0 -0
  229. /package/deps/jq/{src → vendor}/decNumber/decimal64.c +0 -0
  230. /package/deps/jq/{src → vendor}/decNumber/decimal64.h +0 -0
  231. /package/deps/jq/{src → vendor}/decNumber/decnumber.pdf +0 -0
  232. /package/deps/jq/{src → vendor}/decNumber/example1.c +0 -0
  233. /package/deps/jq/{src → vendor}/decNumber/example2.c +0 -0
  234. /package/deps/jq/{src → vendor}/decNumber/example3.c +0 -0
  235. /package/deps/jq/{src → vendor}/decNumber/example4.c +0 -0
  236. /package/deps/jq/{src → vendor}/decNumber/example5.c +0 -0
  237. /package/deps/jq/{src → vendor}/decNumber/example6.c +0 -0
  238. /package/deps/jq/{src → vendor}/decNumber/example7.c +0 -0
  239. /package/deps/jq/{src → vendor}/decNumber/example8.c +0 -0
  240. /package/deps/jq/{src → vendor}/decNumber/readme.txt +0 -0
  241. /package/deps/jq/{modules → vendor}/oniguruma/.travis.yml +0 -0
  242. /package/deps/jq/{modules → vendor}/oniguruma/AUTHORS +0 -0
  243. /package/deps/jq/{modules → vendor}/oniguruma/COPYING +0 -0
  244. /package/deps/jq/{modules → vendor}/oniguruma/ChangeLog +0 -0
  245. /package/deps/jq/{modules → vendor}/oniguruma/NEWS +0 -0
  246. /package/deps/jq/{modules → vendor}/oniguruma/README +0 -0
  247. /package/deps/jq/{modules → vendor}/oniguruma/README_japanese +0 -0
  248. /package/deps/jq/{modules → vendor}/oniguruma/autogen.sh +0 -0
  249. /package/deps/jq/{modules → vendor}/oniguruma/cmake/Config.cmake.in +0 -0
  250. /package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.API +0 -0
  251. /package/deps/jq/{modules → vendor}/oniguruma/doc/CALLOUTS.API.ja +0 -0
  252. /package/deps/jq/{modules → vendor}/oniguruma/doc/FAQ +0 -0
  253. /package/deps/jq/{modules → vendor}/oniguruma/doc/FAQ.ja +0 -0
  254. /package/deps/jq/{modules → vendor}/oniguruma/harnesses/ascii_compatible.dict +0 -0
  255. /package/deps/jq/{modules → vendor}/oniguruma/harnesses/deluxe.c +0 -0
  256. /package/deps/jq/{modules → vendor}/oniguruma/harnesses/dict_conv.py +0 -0
  257. /package/deps/jq/{modules → vendor}/oniguruma/harnesses/fuzzer.options +0 -0
  258. /package/deps/jq/{modules → vendor}/oniguruma/harnesses/libfuzzer-onig.cpp +0 -0
  259. /package/deps/jq/{modules → vendor}/oniguruma/harnesses/regset.c +0 -0
  260. /package/deps/jq/{modules → vendor}/oniguruma/index.html +0 -0
  261. /package/deps/jq/{modules → vendor}/oniguruma/index_ja.html +0 -0
  262. /package/deps/jq/{modules → vendor}/oniguruma/m4/.whatever +0 -0
  263. /package/deps/jq/{modules → vendor}/oniguruma/make_win.bat +0 -0
  264. /package/deps/jq/{modules → vendor}/oniguruma/make_win32.bat +0 -0
  265. /package/deps/jq/{modules → vendor}/oniguruma/make_win64.bat +0 -0
  266. /package/deps/jq/{modules → vendor}/oniguruma/onig-config.cmake.in +0 -0
  267. /package/deps/jq/{modules → vendor}/oniguruma/onig-config.in +0 -0
  268. /package/deps/jq/{modules → vendor}/oniguruma/oniguruma.pc.cmake.in +0 -0
  269. /package/deps/jq/{modules → vendor}/oniguruma/oniguruma.pc.in +0 -0
  270. /package/deps/jq/{modules → vendor}/oniguruma/sample/CMakeLists.txt +0 -0
  271. /package/deps/jq/{modules → vendor}/oniguruma/sample/Makefile.am +0 -0
  272. /package/deps/jq/{modules → vendor}/oniguruma/sample/bug_fix.c +0 -0
  273. /package/deps/jq/{modules → vendor}/oniguruma/sample/callout.c +0 -0
  274. /package/deps/jq/{modules → vendor}/oniguruma/sample/count.c +0 -0
  275. /package/deps/jq/{modules → vendor}/oniguruma/sample/crnl.c +0 -0
  276. /package/deps/jq/{modules → vendor}/oniguruma/sample/echo.c +0 -0
  277. /package/deps/jq/{modules → vendor}/oniguruma/sample/encode.c +0 -0
  278. /package/deps/jq/{modules → vendor}/oniguruma/sample/listcap.c +0 -0
  279. /package/deps/jq/{modules → vendor}/oniguruma/sample/names.c +0 -0
  280. /package/deps/jq/{modules → vendor}/oniguruma/sample/posix.c +0 -0
  281. /package/deps/jq/{modules → vendor}/oniguruma/sample/regset.c +0 -0
  282. /package/deps/jq/{modules → vendor}/oniguruma/sample/scan.c +0 -0
  283. /package/deps/jq/{modules → vendor}/oniguruma/sample/simple.c +0 -0
  284. /package/deps/jq/{modules → vendor}/oniguruma/sample/sql.c +0 -0
  285. /package/deps/jq/{modules → vendor}/oniguruma/sample/syntax.c +0 -0
  286. /package/deps/jq/{modules → vendor}/oniguruma/sample/user_property.c +0 -0
  287. /package/deps/jq/{modules → vendor}/oniguruma/src/Makefile.am +0 -0
  288. /package/deps/jq/{modules → vendor}/oniguruma/src/Makefile.windows +0 -0
  289. /package/deps/jq/{modules → vendor}/oniguruma/src/big5.c +0 -0
  290. /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.cmake.in +0 -0
  291. /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.win32 +0 -0
  292. /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.win64 +0 -0
  293. /package/deps/jq/{modules → vendor}/oniguruma/src/config.h.windows.in +0 -0
  294. /package/deps/jq/{modules → vendor}/oniguruma/src/cp1251.c +0 -0
  295. /package/deps/jq/{modules → vendor}/oniguruma/src/euc_jp.c +0 -0
  296. /package/deps/jq/{modules → vendor}/oniguruma/src/euc_jp_prop.c +0 -0
  297. /package/deps/jq/{modules → vendor}/oniguruma/src/euc_jp_prop.gperf +0 -0
  298. /package/deps/jq/{modules → vendor}/oniguruma/src/euc_kr.c +0 -0
  299. /package/deps/jq/{modules → vendor}/oniguruma/src/euc_tw.c +0 -0
  300. /package/deps/jq/{modules → vendor}/oniguruma/src/gb18030.c +0 -0
  301. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_1.c +0 -0
  302. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_10.c +0 -0
  303. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_11.c +0 -0
  304. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_13.c +0 -0
  305. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_14.c +0 -0
  306. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_15.c +0 -0
  307. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_16.c +0 -0
  308. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_2.c +0 -0
  309. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_3.c +0 -0
  310. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_4.c +0 -0
  311. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_5.c +0 -0
  312. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_6.c +0 -0
  313. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_7.c +0 -0
  314. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_8.c +0 -0
  315. /package/deps/jq/{modules → vendor}/oniguruma/src/iso8859_9.c +0 -0
  316. /package/deps/jq/{modules → vendor}/oniguruma/src/koi8.c +0 -0
  317. /package/deps/jq/{modules → vendor}/oniguruma/src/koi8_r.c +0 -0
  318. /package/deps/jq/{modules → vendor}/oniguruma/src/make_property.sh +0 -0
  319. /package/deps/jq/{modules → vendor}/oniguruma/src/mktable.c +0 -0
  320. /package/deps/jq/{modules → vendor}/oniguruma/src/onig_init.c +0 -0
  321. /package/deps/jq/{modules → vendor}/oniguruma/src/oniggnu.h +0 -0
  322. /package/deps/jq/{modules → vendor}/oniguruma/src/onigposix.h +0 -0
  323. /package/deps/jq/{modules → vendor}/oniguruma/src/regenc.c +0 -0
  324. /package/deps/jq/{modules → vendor}/oniguruma/src/regenc.h +0 -0
  325. /package/deps/jq/{modules → vendor}/oniguruma/src/regext.c +0 -0
  326. /package/deps/jq/{modules → vendor}/oniguruma/src/reggnu.c +0 -0
  327. /package/deps/jq/{modules → vendor}/oniguruma/src/regparse.h +0 -0
  328. /package/deps/jq/{modules → vendor}/oniguruma/src/regposerr.c +0 -0
  329. /package/deps/jq/{modules → vendor}/oniguruma/src/regposix.c +0 -0
  330. /package/deps/jq/{modules → vendor}/oniguruma/src/regtrav.c +0 -0
  331. /package/deps/jq/{modules → vendor}/oniguruma/src/regversion.c +0 -0
  332. /package/deps/jq/{modules → vendor}/oniguruma/src/sjis.c +0 -0
  333. /package/deps/jq/{modules → vendor}/oniguruma/src/sjis_prop.c +0 -0
  334. /package/deps/jq/{modules → vendor}/oniguruma/src/sjis_prop.gperf +0 -0
  335. /package/deps/jq/{modules → vendor}/oniguruma/src/unicode.c +0 -0
  336. /package/deps/jq/{modules → vendor}/oniguruma/src/utf32_be.c +0 -0
  337. /package/deps/jq/{modules → vendor}/oniguruma/src/utf32_le.c +0 -0
  338. /package/deps/jq/{modules → vendor}/oniguruma/src/utf8.c +0 -0
  339. /package/deps/jq/{modules → vendor}/oniguruma/test/CMakeLists.txt +0 -0
  340. /package/deps/jq/{modules → vendor}/oniguruma/test/Makefile.am +0 -0
  341. /package/deps/jq/{modules → vendor}/oniguruma/test/test.sh +0 -0
  342. /package/deps/jq/{modules → vendor}/oniguruma/test/test_regset.c +0 -0
  343. /package/deps/jq/{modules → vendor}/oniguruma/test/testu.c +0 -0
  344. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/stub.c +0 -0
  345. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_back.config +0 -0
  346. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_regset.config +0 -0
  347. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_syntax.config +0 -0
  348. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/test_utf8.config +0 -0
  349. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/testc.config +0 -0
  350. /package/deps/jq/{modules → vendor}/oniguruma/tis-ci/testu.config +0 -0
  351. /package/deps/jq/{modules → vendor}/oniguruma/tis.config +0 -0
  352. /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 filename` / `--from-file filename`:
224
+ * `-f` / `--from-file`:
230
225
 
231
- Read filter from the file rather than from a command line, like
232
- awk's -f option. You can also use '#' to make comments.
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. The following remarks are
361
- therefore offered with the understanding that they are
362
- intended to be descriptive of the current version of jq and
363
- should not be interpreted as being prescriptive:
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, but in expressions such
372
- `1E1234567890`, precision will be lost if the exponent is
373
- too large.
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
- (4) Comparisons are carried out using the untruncated
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: ['[12345678909876543212345,"12345678909876543212345"]']
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: ['"[[1,true],[1.000,true],[1.0,true],[1.00,true]]"']
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: ['[true, false]']
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 contruct generators.
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, $x, in the input array or object,
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, `map_value(f)` constructs
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, $k, of the input. If this
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, $k.
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 overriden in the command-line
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 `gmtime` and output by `mktime`.
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
- to act as though the nearest (to the left) `label $label_name`
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, $names, to store the realnames object, so that we
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; exp)`"
3074
+ - title: "`limit(n; expr)`"
2993
3075
  body: |
2994
3076
 
2995
- The `limit` function extracts up to `n` outputs from `exp`.
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(./2; range(.))]'
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 . end;
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` `pow10` `rint` `round`
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 be necessary to
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 `[0,[1]]`, which is
3320
- `[[0],0],[[1,0],1],[[1,0]],[[1]]`.
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],1],[[1,0],2],[[1,0]],[[1]])'
3431
+ - program: 'truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]])'
3338
3432
  input: '1'
3339
- output: ['[[0],2]', '[[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],1],[[1,0],2],[[1,0]],[[1]]))'
3442
+ - program: 'fromstream(1|truncate_stream([[0],"a"],[[1,0],"b"],[[1,0]],[[1]]))'
3349
3443
  input: 'null'
3350
- output: ['[2]']
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 a search path are subject to various substitutions.
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 `$HOME/.jq` is a file, it is sourced into the main program.
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.3 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
@@ -1,11 +1,6 @@
1
1
  ---
2
2
  headline: jq 1.4 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
@@ -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 `gmtime` and output by `mktime`.
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
- to act as though the nearest (to the left) `label $label_name`
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 a search path are subject to various substitutions.
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 `gmtime` and output by `mktime`.
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
- to act as though the nearest (to the left) `label $label_name`
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 a search path are subject to various substitutions.
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 "~".