@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.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 parseOptions = { ignoreQueryPrefix: true, arrayLimit: -1 };
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
  }
@@ -1115,6 +1116,10 @@ var History = class {
1115
1116
  return window.history.state?.documentScrollPosition || { top: 0, left: 0 };
1116
1117
  }
1117
1118
  replaceState(page2, cb = null) {
1119
+ if (isEqual(this.current, page2)) {
1120
+ cb && cb();
1121
+ return;
1122
+ }
1118
1123
  page.merge(page2);
1119
1124
  if (isServer) {
1120
1125
  return;