@port-labs/jq-node-bindings 1.0.1 → 1.0.2-rc.1
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/deps/jq/COPYING +1 -9
- package/deps/jq/Makefile.am +13 -18
- package/deps/jq/NEWS.md +2 -2
- package/deps/jq/README.md +3 -18
- package/deps/jq/configure.ac +1 -0
- package/deps/jq/docs/Pipfile.lock +59 -72
- package/deps/jq/docs/README.md +1 -1
- package/deps/jq/docs/build_manpage.py +1 -1
- package/deps/jq/docs/build_mantests.py +1 -1
- package/deps/jq/docs/content/download/default.yml +1 -23
- package/deps/jq/docs/content/index.yml +0 -5
- package/deps/jq/docs/content/manual/{dev/manual.yml → manual.yml} +36 -162
- package/deps/jq/docs/content/manual/v1.3/manual.yml +5 -0
- package/deps/jq/docs/content/manual/v1.4/manual.yml +5 -0
- package/deps/jq/docs/content/manual/v1.5/manual.yml +8 -3
- package/deps/jq/docs/content/manual/v1.6/manual.yml +8 -3
- package/deps/jq/docs/content/manual/v1.7/manual.yml +11 -6
- package/deps/jq/docs/content/tutorial/default.yml +3 -3
- package/deps/jq/docs/manual_schema.yml +3 -0
- package/deps/jq/docs/templates/index.html.j2 +6 -6
- package/deps/jq/docs/templates/manual.html.j2 +1 -11
- package/deps/jq/jq.1.prebuilt +26 -162
- package/deps/jq/jq.spec +1 -1
- package/deps/jq/src/builtin.c +211 -298
- package/deps/jq/src/builtin.jq +7 -13
- package/deps/jq/src/bytecode.h +3 -8
- package/deps/jq/src/compile.c +2 -2
- package/deps/jq/src/decNumber/decBasic.c +1 -1
- package/deps/jq/src/decNumber/decCommon.c +1 -1
- package/deps/jq/src/decNumber/decNumber.c +4 -4
- package/deps/jq/src/execute.c +42 -22
- package/deps/jq/src/jq.h +1 -1
- package/deps/jq/src/jq_test.c +7 -69
- package/deps/jq/src/jv.c +12 -17
- package/deps/jq/src/jv.h +0 -3
- package/deps/jq/src/jv_aux.c +4 -3
- package/deps/jq/src/jv_dtoa.c +1 -1
- package/deps/jq/src/jv_parse.c +0 -2
- package/deps/jq/src/jv_print.c +27 -21
- package/deps/jq/src/jv_unicode.c +0 -18
- package/deps/jq/src/jv_unicode.h +0 -2
- package/deps/jq/src/lexer.c +262 -283
- package/deps/jq/src/lexer.h +2 -3
- package/deps/jq/src/lexer.l +1 -7
- package/deps/jq/src/libm.h +5 -15
- package/deps/jq/src/linker.c +4 -6
- package/deps/jq/src/main.c +252 -179
- package/deps/jq/src/util.c +35 -41
- package/deps/jq/src/util.h +1 -1
- package/deps/jq/tests/jq.test +10 -148
- package/deps/jq/tests/jq_fuzz_load_file.c +0 -1
- package/deps/jq/tests/man.test +8 -26
- package/deps/jq/tests/setup +0 -4
- package/deps/jq/tests/shtest +39 -150
- package/index.d.ts +3 -2
- package/lib/jq.js +2 -2
- package/lib/templateAsync.js +8 -15
- package/package.json +2 -2
- package/src/binding.cc +46 -27
- package/test/santiy-async.test.js +4 -0
- package/deps/jq/sig/v1.7.1/jq-1.7.1.tar.gz.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-1.7.1.zip.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-amd64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-arm64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-armel.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-armhf.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-i386.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mips.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mips64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mips64el.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mips64r6el.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mipsel.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-mipsr6el.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-powerpc.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-ppc64el.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-riscv64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux-s390x.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-linux64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-macos-amd64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-macos-arm64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-osx-amd64.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-win64.exe.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-windows-amd64.exe.asc +0 -16
- package/deps/jq/sig/v1.7.1/jq-windows-i386.exe.asc +0 -16
- package/deps/jq/sig/v1.7.1/sha256sum.txt +0 -26
- package/deps/jq/tests/uri.test +0 -38
- package/deps/jq/tests/uritest +0 -5
package/deps/jq/src/util.c
CHANGED
|
@@ -107,12 +107,12 @@ jv get_home() {
|
|
|
107
107
|
#else
|
|
108
108
|
home = getenv("USERPROFILE");
|
|
109
109
|
if (!home) {
|
|
110
|
+
char *hd = getenv("HOMEDRIVE");
|
|
111
|
+
if (!hd) hd = "";
|
|
110
112
|
home = getenv("HOMEPATH");
|
|
111
113
|
if (!home) {
|
|
112
114
|
ret = jv_invalid_with_msg(jv_string("Could not find home directory."));
|
|
113
115
|
} else {
|
|
114
|
-
const char *hd = getenv("HOMEDRIVE");
|
|
115
|
-
if (!hd) hd = "";
|
|
116
116
|
ret = jv_string_fmt("%s%s",hd,home);
|
|
117
117
|
}
|
|
118
118
|
} else {
|
|
@@ -451,7 +451,7 @@ jv jq_util_input_next_input(jq_util_input_state *state) {
|
|
|
451
451
|
return value;
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
-
#
|
|
454
|
+
#if defined(WIN32) && !defined(HAVE_STRPTIME)
|
|
455
455
|
/* http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/lib/libc/time/strptime.c?only_with_tag=HEAD
|
|
456
456
|
* NetBSD implementation strptime().
|
|
457
457
|
* Format description: https://netbsd.gw.com/cgi-bin/man-cgi?strptime+3+NetBSD-current
|
|
@@ -533,32 +533,32 @@ static const unsigned char *find_string(const unsigned char *, int *, const char
|
|
|
533
533
|
static char* utc = "UTC";
|
|
534
534
|
#endif
|
|
535
535
|
/* RFC-822/RFC-2822 */
|
|
536
|
-
static const char
|
|
536
|
+
static const char* const nast[] = {
|
|
537
537
|
"EST", "CST", "MST", "PST", "\0\0\0"
|
|
538
538
|
};
|
|
539
|
-
static const char
|
|
539
|
+
static const char* const nadt[] = {
|
|
540
540
|
"EDT", "CDT", "MDT", "PDT", "\0\0\0"
|
|
541
541
|
};
|
|
542
|
-
static const char
|
|
542
|
+
static const char* weekday_name[] =
|
|
543
543
|
{
|
|
544
544
|
"Sunday", "Monday", "Tuesday", "Wednesday",
|
|
545
545
|
"Thursday", "Friday", "Saturday"
|
|
546
546
|
};
|
|
547
|
-
static const char
|
|
547
|
+
static const char* ab_weekday_name[] =
|
|
548
548
|
{
|
|
549
549
|
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
|
550
550
|
};
|
|
551
|
-
static const char
|
|
551
|
+
static const char* month_name[] =
|
|
552
552
|
{
|
|
553
553
|
"January", "February", "March", "April", "May", "June",
|
|
554
554
|
"July", "August", "September", "October", "November", "December"
|
|
555
555
|
};
|
|
556
|
-
static const char
|
|
556
|
+
static const char* ab_month_name[] =
|
|
557
557
|
{
|
|
558
558
|
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
|
559
559
|
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
|
560
560
|
};
|
|
561
|
-
static const char
|
|
561
|
+
static const char* am_pm[] = {"AM", "PM"};
|
|
562
562
|
|
|
563
563
|
|
|
564
564
|
/*
|
|
@@ -708,7 +708,7 @@ recurse:
|
|
|
708
708
|
continue;
|
|
709
709
|
|
|
710
710
|
case 'x': /* The date, using the locale's format. */
|
|
711
|
-
/* fall
|
|
711
|
+
/* fall throug */
|
|
712
712
|
|
|
713
713
|
case 'D': /* The date as "%y/%m/%d". */
|
|
714
714
|
{
|
|
@@ -818,46 +818,40 @@ recurse:
|
|
|
818
818
|
LEGAL_ALT(ALT_O);
|
|
819
819
|
continue;
|
|
820
820
|
|
|
821
|
-
|
|
822
|
-
#
|
|
823
|
-
const time_t TIME_MAX = INT32_MAX;
|
|
824
|
-
#else
|
|
825
|
-
const time_t TIME_MAX = INT64_MAX;
|
|
821
|
+
#ifndef TIME_MAX
|
|
822
|
+
#define TIME_MAX INT64_MAX
|
|
826
823
|
#endif
|
|
827
|
-
|
|
824
|
+
case 's': /* seconds since the epoch */
|
|
825
|
+
{
|
|
826
|
+
time_t sse = 0;
|
|
827
|
+
uint64_t rulim = TIME_MAX;
|
|
828
828
|
|
|
829
|
-
|
|
830
|
-
bp = NULL;
|
|
831
|
-
continue;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
sse = *bp++ - '0';
|
|
835
|
-
while (*bp >= '0' && *bp <= '9') {
|
|
836
|
-
d = *bp++ - '0';
|
|
837
|
-
if (sse > TIME_MAX/10) {
|
|
829
|
+
if (*bp < '0' || *bp > '9') {
|
|
838
830
|
bp = NULL;
|
|
839
|
-
|
|
831
|
+
continue;
|
|
840
832
|
}
|
|
841
|
-
|
|
842
|
-
|
|
833
|
+
|
|
834
|
+
do {
|
|
835
|
+
sse *= 10;
|
|
836
|
+
sse += *bp++ - '0';
|
|
837
|
+
rulim /= 10;
|
|
838
|
+
} while ((sse * 10 <= TIME_MAX) &&
|
|
839
|
+
rulim && *bp >= '0' && *bp <= '9');
|
|
840
|
+
|
|
841
|
+
if (sse < 0 || (uint64_t)sse > TIME_MAX) {
|
|
843
842
|
bp = NULL;
|
|
844
|
-
|
|
843
|
+
continue;
|
|
845
844
|
}
|
|
846
|
-
sse += d;
|
|
847
|
-
}
|
|
848
|
-
if (bp == NULL)
|
|
849
|
-
continue;
|
|
850
|
-
|
|
851
845
|
#ifdef _WIN32
|
|
852
|
-
|
|
846
|
+
if (localtime_s(tm, &sse) == 0)
|
|
853
847
|
#else
|
|
854
|
-
|
|
848
|
+
if (localtime_r(&sse, tm))
|
|
855
849
|
#endif
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
continue;
|
|
850
|
+
state |= S_YDAY | S_WDAY | S_MON | S_MDAY | S_YEAR;
|
|
851
|
+
else
|
|
852
|
+
bp = NULL;
|
|
860
853
|
}
|
|
854
|
+
continue;
|
|
861
855
|
|
|
862
856
|
case 'U': /* The week of year, beginning on sunday. */
|
|
863
857
|
case 'W': /* The week of year, beginning on monday. */
|
package/deps/jq/src/util.h
CHANGED
package/deps/jq/tests/jq.test
CHANGED
|
@@ -61,7 +61,7 @@ null
|
|
|
61
61
|
null
|
|
62
62
|
"interpolation"
|
|
63
63
|
|
|
64
|
-
@text,@json,([1,.]|@csv,@tsv),@html
|
|
64
|
+
@text,@json,([1,.]|@csv,@tsv),@html,@uri,@sh,(@base64|.,@base64d)
|
|
65
65
|
"!()<>&'\"\t"
|
|
66
66
|
"!()<>&'\"\t"
|
|
67
67
|
"\"!()<>&'\\\"\\t\""
|
|
@@ -69,7 +69,6 @@ null
|
|
|
69
69
|
"1\t!()<>&'\"\\t"
|
|
70
70
|
"!()<>&'"\t"
|
|
71
71
|
"%21%28%29%3C%3E%26%27%22%09"
|
|
72
|
-
"!()<>&'\"\t"
|
|
73
72
|
"'!()<>&'\\''\"\t'"
|
|
74
73
|
"ISgpPD4mJyIJ"
|
|
75
74
|
"!()<>&'\"\t"
|
|
@@ -87,10 +86,6 @@ null
|
|
|
87
86
|
"\u03bc"
|
|
88
87
|
"%CE%BC"
|
|
89
88
|
|
|
90
|
-
@urid
|
|
91
|
-
"%CE%BC"
|
|
92
|
-
"\u03bc"
|
|
93
|
-
|
|
94
89
|
@html "<b>\(.)</b>"
|
|
95
90
|
"<script>hax</script>"
|
|
96
91
|
"<b><script>hax</script></b>"
|
|
@@ -183,11 +178,6 @@ map(try .a[] catch ., try .a.[] catch ., .a[]?, .a.[]?)
|
|
|
183
178
|
[{"a": [1,2]}, {"a": 123}]
|
|
184
179
|
[1,2,1,2,1,2,1,2,"Cannot iterate over number (123)","Cannot iterate over number (123)"]
|
|
185
180
|
|
|
186
|
-
# oss-fuzz #66070: objects[] leaks if a non-last element throws an error
|
|
187
|
-
try ["OK", (.[] | error)] catch ["KO", .]
|
|
188
|
-
{"a":["b"],"c":["d"]}
|
|
189
|
-
["KO",["b"]]
|
|
190
|
-
|
|
191
181
|
#
|
|
192
182
|
# Negative array indices
|
|
193
183
|
#
|
|
@@ -322,10 +312,6 @@ null
|
|
|
322
312
|
[{"a":1}, {"b":2}, {"a":3, "b":4}]
|
|
323
313
|
[-1, -1, -4]
|
|
324
314
|
|
|
325
|
-
[foreach range(5) as $x (0; .+$x | select($x!=2); [$x,.])]
|
|
326
|
-
null
|
|
327
|
-
[[0,0],[1,1],[3,4],[4,8]]
|
|
328
|
-
|
|
329
315
|
[limit(3; .[])]
|
|
330
316
|
[11,22,33,44,55,66,77,88,99]
|
|
331
317
|
[11,22,33]
|
|
@@ -338,38 +324,10 @@ null
|
|
|
338
324
|
"badness"
|
|
339
325
|
[1]
|
|
340
326
|
|
|
341
|
-
try limit(-1; error) catch .
|
|
342
|
-
null
|
|
343
|
-
"limit doesn't support negative count"
|
|
344
|
-
|
|
345
|
-
[skip(3; .[])]
|
|
346
|
-
[1,2,3,4,5,6,7,8,9]
|
|
347
|
-
[4,5,6,7,8,9]
|
|
348
|
-
|
|
349
|
-
[skip(0,2,3,4; .[])]
|
|
350
|
-
[1,2,3]
|
|
351
|
-
[1,2,3,3]
|
|
352
|
-
|
|
353
|
-
[skip(3; .[])]
|
|
354
|
-
[]
|
|
355
|
-
[]
|
|
356
|
-
|
|
357
|
-
try skip(-1; error) catch .
|
|
358
|
-
null
|
|
359
|
-
"skip doesn't support negative count"
|
|
360
|
-
|
|
361
|
-
nth(1; 0,1,error("foo"))
|
|
362
|
-
null
|
|
363
|
-
1
|
|
364
|
-
|
|
365
327
|
[first(range(.)), last(range(.))]
|
|
366
328
|
10
|
|
367
329
|
[0,9]
|
|
368
330
|
|
|
369
|
-
[first(range(.)), last(range(.))]
|
|
370
|
-
0
|
|
371
|
-
[]
|
|
372
|
-
|
|
373
331
|
[nth(0,5,9,10,15; range(.)), try nth(-1; range(.)) catch .]
|
|
374
332
|
10
|
|
375
333
|
[0,5,9,"nth doesn't support negative indices"]
|
|
@@ -679,19 +637,6 @@ map_values(.+1)
|
|
|
679
637
|
[0,1,2]
|
|
680
638
|
[1,2,3]
|
|
681
639
|
|
|
682
|
-
[add(null), add(range(range(10))), add(empty), add(10,range(10))]
|
|
683
|
-
null
|
|
684
|
-
[null,120,null,55]
|
|
685
|
-
|
|
686
|
-
# Real-world use case for add(empty)
|
|
687
|
-
.sum = add(.arr[])
|
|
688
|
-
{"arr":[]}
|
|
689
|
-
{"arr":[],"sum":null}
|
|
690
|
-
|
|
691
|
-
add({(.[]):1}) | keys
|
|
692
|
-
["a","a","b","a","d","b","d","a","d"]
|
|
693
|
-
["a","b","d"]
|
|
694
|
-
|
|
695
640
|
#
|
|
696
641
|
# User-defined functions
|
|
697
642
|
# Oh god.
|
|
@@ -829,10 +774,6 @@ reduce . as $n (.; .)
|
|
|
829
774
|
null
|
|
830
775
|
null
|
|
831
776
|
|
|
832
|
-
reduce range(5) as $x (0; .+$x | select($x!=2))
|
|
833
|
-
null
|
|
834
|
-
8
|
|
835
|
-
|
|
836
777
|
# Destructuring
|
|
837
778
|
. as {$a, b: [$c, {$d}]} | [$a, $c, $d]
|
|
838
779
|
{"a":1, "b":[2,{"d":3}]}
|
|
@@ -1388,26 +1329,6 @@ split("")
|
|
|
1388
1329
|
"xababababax"
|
|
1389
1330
|
[1,7,[1,3,5,7]]
|
|
1390
1331
|
|
|
1391
|
-
# trim
|
|
1392
|
-
# \u000b is vertical tab (\v not supported by json)
|
|
1393
|
-
map(trim), map(ltrim), map(rtrim)
|
|
1394
|
-
[" \n\t\r\f\u000b", ""," ", "a", " a ", "abc", " abc ", " abc", "abc "]
|
|
1395
|
-
["", "", "", "a", "a", "abc", "abc", "abc", "abc"]
|
|
1396
|
-
["", "", "", "a", "a ", "abc", "abc ", "abc", "abc "]
|
|
1397
|
-
["", "", "", "a", " a", "abc", " abc", " abc", "abc"]
|
|
1398
|
-
|
|
1399
|
-
trim, ltrim, rtrim
|
|
1400
|
-
"\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000abc\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000"
|
|
1401
|
-
"abc"
|
|
1402
|
-
"abc\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000"
|
|
1403
|
-
"\u0009\u000A\u000B\u000C\u000D\u0020\u0085\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000abc"
|
|
1404
|
-
|
|
1405
|
-
try trim catch ., try ltrim catch ., try rtrim catch .
|
|
1406
|
-
123
|
|
1407
|
-
"trim input must be a string"
|
|
1408
|
-
"trim input must be a string"
|
|
1409
|
-
"trim input must be a string"
|
|
1410
|
-
|
|
1411
1332
|
indices(1)
|
|
1412
1333
|
[0,1,1,2,3,4,1,5]
|
|
1413
1334
|
[1,2,6]
|
|
@@ -1424,22 +1345,6 @@ indices(", ")
|
|
|
1424
1345
|
"a,b, cd,e, fgh, ijkl"
|
|
1425
1346
|
[3,9,14]
|
|
1426
1347
|
|
|
1427
|
-
index("!")
|
|
1428
|
-
"здравствуй мир!"
|
|
1429
|
-
14
|
|
1430
|
-
|
|
1431
|
-
.[:rindex("x")]
|
|
1432
|
-
"正xyz"
|
|
1433
|
-
"正"
|
|
1434
|
-
|
|
1435
|
-
indices("o")
|
|
1436
|
-
"🇬🇧oo"
|
|
1437
|
-
[2,3]
|
|
1438
|
-
|
|
1439
|
-
indices("o")
|
|
1440
|
-
"ƒoo"
|
|
1441
|
-
[1,2]
|
|
1442
|
-
|
|
1443
1348
|
[.[]|split(",")]
|
|
1444
1349
|
["a, bc, def, ghij, jklmn, a,b, c,d, e,f", "a,b,c,d, e,f,g,h"]
|
|
1445
1350
|
[["a"," bc"," def"," ghij"," jklmn"," a","b"," c","d"," e","f"],["a","b","c","d"," e","f","g","h"]]
|
|
@@ -1658,14 +1563,6 @@ strftime("%A, %B %d, %Y")
|
|
|
1658
1563
|
1435677542.822351
|
|
1659
1564
|
"Tuesday, June 30, 2015"
|
|
1660
1565
|
|
|
1661
|
-
strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
1662
|
-
[2024,2,15]
|
|
1663
|
-
"2024-03-15T00:00:00Z"
|
|
1664
|
-
|
|
1665
|
-
mktime
|
|
1666
|
-
[2024,8,21]
|
|
1667
|
-
1726876800
|
|
1668
|
-
|
|
1669
1566
|
gmtime
|
|
1670
1567
|
1425599507
|
|
1671
1568
|
[2015,2,5,23,51,47,4,63]
|
|
@@ -1683,15 +1580,6 @@ try mktime catch .
|
|
|
1683
1580
|
["a",1,2,3,4,5,6,7]
|
|
1684
1581
|
"mktime requires parsed datetime inputs"
|
|
1685
1582
|
|
|
1686
|
-
# oss-fuzz #67403: non-string argument with number input fails assert
|
|
1687
|
-
try ["OK", strftime([])] catch ["KO", .]
|
|
1688
|
-
0
|
|
1689
|
-
["KO","strftime/1 requires a string format"]
|
|
1690
|
-
|
|
1691
|
-
try ["OK", strflocaltime({})] catch ["KO", .]
|
|
1692
|
-
0
|
|
1693
|
-
["KO","strflocaltime/1 requires a string format"]
|
|
1694
|
-
|
|
1695
1583
|
# module system
|
|
1696
1584
|
import "a" as foo; import "b" as bar; def fooa: foo::a; [fooa, bar::a, bar::b, foo::a]
|
|
1697
1585
|
null
|
|
@@ -1948,17 +1836,17 @@ map(. == 1)
|
|
|
1948
1836
|
|
|
1949
1837
|
# When no arithmetic is involved jq should preserve the literal value
|
|
1950
1838
|
|
|
1951
|
-
.[0] | tostring
|
|
1839
|
+
.[0] | tostring
|
|
1952
1840
|
[13911860366432393]
|
|
1953
|
-
|
|
1841
|
+
"13911860366432393"
|
|
1954
1842
|
|
|
1955
|
-
.x | tojson
|
|
1843
|
+
.x | tojson
|
|
1956
1844
|
{"x":13911860366432393}
|
|
1957
|
-
|
|
1845
|
+
"13911860366432393"
|
|
1958
1846
|
|
|
1959
|
-
|
|
1847
|
+
13911860366432393 == 13911860366432392
|
|
1960
1848
|
null
|
|
1961
|
-
|
|
1849
|
+
false
|
|
1962
1850
|
|
|
1963
1851
|
|
|
1964
1852
|
# Applying arithmetic to the value will truncate the result to double
|
|
@@ -2051,7 +1939,7 @@ tojson | fromjson
|
|
|
2051
1939
|
{"a":null}
|
|
2052
1940
|
|
|
2053
1941
|
# also "nan with payload" #2985
|
|
2054
|
-
|
|
1942
|
+
fromjson | isnan
|
|
2055
1943
|
"nan1234"
|
|
2056
1944
|
true
|
|
2057
1945
|
|
|
@@ -2112,8 +2000,8 @@ null
|
|
|
2112
2000
|
2
|
|
2113
2001
|
|
|
2114
2002
|
.[] |= try tonumber
|
|
2115
|
-
["1", "2a", "3",
|
|
2116
|
-
[1, 3,
|
|
2003
|
+
["1", "2a", "3", 4]
|
|
2004
|
+
[1, 3, 4]
|
|
2117
2005
|
|
|
2118
2006
|
# Also 1859, but from 2073
|
|
2119
2007
|
any(keys[]|tostring?;true)
|
|
@@ -2215,9 +2103,6 @@ try ["ok", setpath([1]; 1)] catch ["ko", .]
|
|
|
2215
2103
|
{"hi":"hello"}
|
|
2216
2104
|
["ko","Cannot index object with number"]
|
|
2217
2105
|
|
|
2218
|
-
try fromjson catch .
|
|
2219
|
-
"{'a': 123}"
|
|
2220
|
-
"Invalid string literal; expected \", but got ' at line 1, column 5 (while parsing '{'a': 123}')"
|
|
2221
2106
|
|
|
2222
2107
|
# ltrimstr/1 rtrimstr/1 don't leak on invalid input #2977
|
|
2223
2108
|
|
|
@@ -2230,26 +2115,3 @@ try ltrimstr("x") catch "x", try rtrimstr("x") catch "x" | "ok"
|
|
|
2230
2115
|
{"hey":[]}
|
|
2231
2116
|
"ok"
|
|
2232
2117
|
"ok"
|
|
2233
|
-
|
|
2234
|
-
# ltrimstr/1 and rtrimstr/1 return an error for non-strings. #2969
|
|
2235
|
-
|
|
2236
|
-
.[] as [$x, $y] | try ["ok", ($x | ltrimstr($y))] catch ["ko", .]
|
|
2237
|
-
[["hi",1],[1,"hi"],["hi","hi"],[1,1]]
|
|
2238
|
-
["ko","startswith() requires string inputs"]
|
|
2239
|
-
["ko","startswith() requires string inputs"]
|
|
2240
|
-
["ok",""]
|
|
2241
|
-
["ko","startswith() requires string inputs"]
|
|
2242
|
-
|
|
2243
|
-
.[] as [$x, $y] | try ["ok", ($x | rtrimstr($y))] catch ["ko", .]
|
|
2244
|
-
[["hi",1],[1,"hi"],["hi","hi"],[1,1]]
|
|
2245
|
-
["ko","endswith() requires string inputs"]
|
|
2246
|
-
["ko","endswith() requires string inputs"]
|
|
2247
|
-
["ok",""]
|
|
2248
|
-
["ko","endswith() requires string inputs"]
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
# oss-fuzz #66061: setpath/2 leaks when indexing array with array
|
|
2252
|
-
|
|
2253
|
-
try ["OK", setpath([[1]]; 1)] catch ["KO", .]
|
|
2254
|
-
[]
|
|
2255
|
-
["KO","Cannot update field at array index of array"]
|
package/deps/jq/tests/man.test
CHANGED
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
0.12345678901234567890123456789
|
|
7
7
|
0.12345678901234567890123456789
|
|
8
8
|
|
|
9
|
-
[., tojson]
|
|
9
|
+
[., tojson]
|
|
10
10
|
12345678909876543212345
|
|
11
|
-
|
|
11
|
+
[12345678909876543212345,"12345678909876543212345"]
|
|
12
12
|
|
|
13
13
|
. < 0.12345678901234567890123456788
|
|
14
14
|
0.12345678901234567890123456789
|
|
15
15
|
false
|
|
16
16
|
|
|
17
|
-
map([., . == 1]) | tojson
|
|
17
|
+
map([., . == 1]) | tojson
|
|
18
18
|
[1, 1.000, 1.0, 100e-2]
|
|
19
|
-
true
|
|
19
|
+
"[[1,true],[1.000,true],[1.0,true],[1.00,true]]"
|
|
20
20
|
|
|
21
|
-
. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000)
|
|
21
|
+
. as $big | [$big, $big + 1] | map(. > 10000000000000000000000000000000)
|
|
22
22
|
10000000000000000000000000000001
|
|
23
|
-
true
|
|
23
|
+
[true, false]
|
|
24
24
|
|
|
25
25
|
.foo
|
|
26
26
|
{"foo": 42, "bar": "less interesting data"}
|
|
@@ -358,10 +358,6 @@ add
|
|
|
358
358
|
[]
|
|
359
359
|
null
|
|
360
360
|
|
|
361
|
-
add(.[].a)
|
|
362
|
-
[{"a":3}, {"a":5}, {"b":6}]
|
|
363
|
-
8
|
|
364
|
-
|
|
365
361
|
any
|
|
366
362
|
[true, false]
|
|
367
363
|
true
|
|
@@ -606,12 +602,6 @@ combinations(2)
|
|
|
606
602
|
["fo", "foo", "barfoo", "foobar", "foob"]
|
|
607
603
|
["fo","","bar","foobar","foob"]
|
|
608
604
|
|
|
609
|
-
trim, ltrim, rtrim
|
|
610
|
-
" abc "
|
|
611
|
-
"abc"
|
|
612
|
-
"abc "
|
|
613
|
-
" abc"
|
|
614
|
-
|
|
615
605
|
explode
|
|
616
606
|
"foobar"
|
|
617
607
|
[102,111,111,98,97,114]
|
|
@@ -873,22 +863,14 @@ isempty(.[])
|
|
|
873
863
|
[1,2,3]
|
|
874
864
|
false
|
|
875
865
|
|
|
876
|
-
[limit(3
|
|
866
|
+
[limit(3;.[])]
|
|
877
867
|
[0,1,2,3,4,5,6,7,8,9]
|
|
878
868
|
[0,1,2]
|
|
879
869
|
|
|
880
|
-
[
|
|
881
|
-
[0,1,2,3,4,5,6,7,8,9]
|
|
882
|
-
[3,4,5,6,7,8,9]
|
|
883
|
-
|
|
884
|
-
[first(range(.)), last(range(.)), nth(5; range(.))]
|
|
870
|
+
[first(range(.)), last(range(.)), nth(./2; range(.))]
|
|
885
871
|
10
|
|
886
872
|
[0,9,5]
|
|
887
873
|
|
|
888
|
-
[first(empty), last(empty), nth(5; empty)]
|
|
889
|
-
null
|
|
890
|
-
[]
|
|
891
|
-
|
|
892
874
|
[range(.)]|[first, last, nth(5)]
|
|
893
875
|
10
|
|
894
876
|
[0,9,5]
|
package/deps/jq/tests/setup
CHANGED
|
@@ -12,10 +12,6 @@ JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
|
|
|
12
12
|
JQBASEDIR=$JQTESTDIR/..
|
|
13
13
|
JQ=${JQ:-$JQBASEDIR/jq}
|
|
14
14
|
|
|
15
|
-
# Some tests have locale-dependent output; use C locale. Fixes #3038
|
|
16
|
-
LC_ALL=C
|
|
17
|
-
export LC_ALL
|
|
18
|
-
|
|
19
15
|
if [ -z "${NO_VALGRIND-}" ] && which valgrind > /dev/null; then
|
|
20
16
|
VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
|
|
21
17
|
--suppressions=$JQTESTDIR/onig.supp \
|