@ethlete/query 5.44.0 → 5.44.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ethlete/query
|
|
2
2
|
|
|
3
|
+
## 5.44.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2c02096`](https://github.com/ethlete-io/ethdk/commit/2c020964d1b57ebaa483035be59ee84a15d1794e) Thanks [@TomTomB](https://github.com/TomTomB)! - Give each object in an array its own index when `writeArrayIndexes` is enabled. Before, every object item was serialized at index `0`.
|
|
8
|
+
|
|
3
9
|
## 5.44.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -140,21 +140,24 @@ const buildQueryString = (params, config) => {
|
|
|
140
140
|
}
|
|
141
141
|
else if (Array.isArray(value)) {
|
|
142
142
|
let currentFilteredIndex = 0;
|
|
143
|
+
let didAddAnyValue = false;
|
|
143
144
|
for (const arrayValue of value) {
|
|
144
145
|
const nestedKey = writeArrayIndexes ? `${key}[${currentFilteredIndex}]` : `${key}[]`;
|
|
145
146
|
const didAddValue = processValue(nestedKey, arrayValue);
|
|
146
147
|
if (didAddValue) {
|
|
147
148
|
currentFilteredIndex++;
|
|
149
|
+
didAddAnyValue = true;
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
|
-
return
|
|
152
|
+
return didAddAnyValue;
|
|
151
153
|
}
|
|
152
154
|
else if (typeof value === 'object' && value !== null) {
|
|
155
|
+
let didAddAnyValue = false;
|
|
153
156
|
for (const [objKey, val] of Object.entries(value)) {
|
|
154
157
|
const nestedKey = objectNotation === 'dot' ? `${key}.${objKey}` : `${key}[${objKey}]`;
|
|
155
|
-
processValue(nestedKey, val);
|
|
158
|
+
didAddAnyValue = processValue(nestedKey, val) || didAddAnyValue;
|
|
156
159
|
}
|
|
157
|
-
return
|
|
160
|
+
return didAddAnyValue;
|
|
158
161
|
}
|
|
159
162
|
else {
|
|
160
163
|
if (ignoredValues.includes(value)) {
|