@inertiajs/core 2.3.5 → 2.3.6
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/dist/index.esm.js +3 -2
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -735,12 +735,13 @@ function mergeDataIntoQueryString(method, href, data, qsArrayFormat = "brackets"
|
|
|
735
735
|
const hasHash = href.toString().includes("#");
|
|
736
736
|
const url = new URL(href.toString(), typeof window === "undefined" ? "http://localhost" : window.location.toString());
|
|
737
737
|
if (hasDataForQueryString) {
|
|
738
|
-
const
|
|
738
|
+
const hasIndices = /\[\d+\]/.test(url.search);
|
|
739
|
+
const parseOptions = { ignoreQueryPrefix: true, allowSparse: true };
|
|
739
740
|
url.search = qs.stringify(
|
|
740
741
|
{ ...qs.parse(url.search, parseOptions), ...data },
|
|
741
742
|
{
|
|
742
743
|
encodeValuesOnly: true,
|
|
743
|
-
arrayFormat: qsArrayFormat
|
|
744
|
+
arrayFormat: hasIndices ? "indices" : qsArrayFormat
|
|
744
745
|
}
|
|
745
746
|
);
|
|
746
747
|
}
|