You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Use decimal number literals to preserve precision. Comparison operations respects precision but arithmetic operations might truncate. @leonid-s-usov#1752
86
+
78
87
```sh
79
88
# precision is preserved
80
89
$ jq -n '100000000000000000'
@@ -86,7 +95,9 @@ Full commit log can be found at https://github.com/jqlang/jq/compare/jq-1.6...jq
86
95
$ jq -n '100000000000000000+10'
87
96
100000000000000020
88
97
```
98
+
89
99
- Adds new builtin `pick(stream)` to emit a projection of the input object or array. @pkoppstein#2656
@@ -97,7 +108,9 @@ Full commit log can be found at https://github.com/jqlang/jq/compare/jq-1.6...jq
97
108
"x": null
98
109
}
99
110
```
111
+
100
112
- Adds new builtin `debug(msgs)` that works like `debug` but applies a filter on the input before writing to stderr. @pkoppstein#2710
113
+
101
114
```sh
102
115
$ jq -n '1 as $x | 2 | debug("Entering function foo with $x == \($x)", .) | (.+1)'
103
116
["DEBUG:","Entering function foo with $x == 1"]
@@ -111,15 +124,19 @@ Full commit log can be found at https://github.com/jqlang/jq/compare/jq-1.6...jq
111
124
"c": 3
112
125
}
113
126
```
127
+
114
128
- Adds new builtin `scan($re; $flags)`. Was documented but not implemented. @itchyny#1961
129
+
115
130
```sh
116
131
# look for pattern "ab" in "abAB" ignoring casing
117
132
$ jq -n '"abAB" | scan("ab"; "i")'
118
133
"ab"
119
134
"AB"
120
135
```
136
+
121
137
- Adds new builtin `abs` to get absolute value. This potentially allows the literal value of numbers to be preserved as `length` and `fabs` convert to float. @pkoppstein#2767
122
138
- Allow `if` without `else`-branch. When skipped the `else`-branch will be `.` (identity). @chancez@wader#1825#2481
139
+
123
140
```sh
124
141
# convert 1 to "one" otherwise keep as is
125
142
$ jq -n '1,2 | if . == 1 then "one" end'
@@ -135,7 +152,9 @@ Full commit log can be found at https://github.com/jqlang/jq/compare/jq-1.6...jq
135
152
"two"
136
153
3
137
154
```
155
+
138
156
- Allow use of `$binding` as key in object literals. 8ea4a55 @nicowilliams
157
+
139
158
```sh
140
159
$ jq -n '"a" as $key| {$key: 123}'
141
160
{
@@ -147,26 +166,31 @@ Full commit log can be found at https://github.com/jqlang/jq/compare/jq-1.6...jq
147
166
"a": 123
148
167
}
149
168
```
169
+
150
170
- Allow dot between chained indexes when using `.["index"]` @nicowilliams #1168
171
+
151
172
```sh
152
173
$ jq -n '{"a": {"b": 123}} | .a["b"]'
153
174
123
154
175
# now this works also
155
176
$ jq -n '{"a": {"b": 123}} | .a.["b"]'
156
177
123
157
178
```
179
+
158
180
- Fix try/catch catches more than it should. @nicowilliams #2750
159
181
- Speed up and refactor some builtins, also remove `scalars_or_empty/0`. @muhmuhten #1845
160
182
- Now `halt` and `halt_error` exit immediately instead of continuing to the next input. @emanuele6 #2667
161
183
- Fix issue converting string to number after previous convert error. @thalman #2400
162
184
- Make 0 divided by 0 result in NaN consistently. @itchyny #2253
163
185
- Fix issue representing large numbers on some platforms causing invalid JSON output. @itchyny #2661
164
186
- Fix deletion using assigning empty against arrays. @itchyny #2133
187
+
165
188
```sh
166
189
# now this works as expected, filter out all values over 2 by assigning empty
0 commit comments