@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.js CHANGED
@@ -792,12 +792,13 @@ function mergeDataIntoQueryString(method, href, data, qsArrayFormat = "brackets"
792
792
  const hasHash = href.toString().includes("#");
793
793
  const url = new URL(href.toString(), typeof window === "undefined" ? "http://localhost" : window.location.toString());
794
794
  if (hasDataForQueryString) {
795
- const parseOptions = { ignoreQueryPrefix: true, arrayLimit: -1 };
795
+ const hasIndices = /\[\d+\]/.test(url.search);
796
+ const parseOptions = { ignoreQueryPrefix: true, allowSparse: true };
796
797
  url.search = qs.stringify(
797
798
  { ...qs.parse(url.search, parseOptions), ...data },
798
799
  {
799
800
  encodeValuesOnly: true,
800
- arrayFormat: qsArrayFormat
801
+ arrayFormat: hasIndices ? "indices" : qsArrayFormat
801
802
  }
802
803
  );
803
804
  }