@steroidsjs/core 2.2.65 → 2.2.66
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/hooks/useAddressBar.js +7 -2
- package/package.json +1 -1
package/hooks/useAddressBar.js
CHANGED
|
@@ -123,9 +123,14 @@ function useAddressBar(config) {
|
|
|
123
123
|
var dispatch = useDispatch_1["default"]();
|
|
124
124
|
var updateQuery = react_1.useCallback(function (values) {
|
|
125
125
|
if (config.enable) {
|
|
126
|
+
// Remove all 'undefined' values or empty objects/arrays from passed form values
|
|
126
127
|
var normalizedValues = Object.keys(values).reduce(function (obj, key) {
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
var value = values[key];
|
|
129
|
+
var isValidValue = typeof value === 'object'
|
|
130
|
+
? !isEmpty_1["default"](value)
|
|
131
|
+
: value !== undefined;
|
|
132
|
+
if (isValidValue) {
|
|
133
|
+
obj[key] = value;
|
|
129
134
|
}
|
|
130
135
|
return obj;
|
|
131
136
|
}, {});
|