@inertiajs/core 2.3.5 → 2.3.7

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
  }
@@ -1172,6 +1173,10 @@ var History = class {
1172
1173
  return window.history.state?.documentScrollPosition || { top: 0, left: 0 };
1173
1174
  }
1174
1175
  replaceState(page2, cb = null) {
1176
+ if ((0, import_lodash_es3.isEqual)(this.current, page2)) {
1177
+ cb && cb();
1178
+ return;
1179
+ }
1175
1180
  page.merge(page2);
1176
1181
  if (isServer) {
1177
1182
  return;