@inertiajs/core 2.2.16 → 2.2.18

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
@@ -32,7 +32,8 @@ var Config = class {
32
32
  };
33
33
  var config = new Config({
34
34
  form: {
35
- recentlySuccessfulDuration: 2e3
35
+ recentlySuccessfulDuration: 2e3,
36
+ forceIndicesArrayFormatInFormData: true
36
37
  },
37
38
  future: {
38
39
  preserveEqualProps: false,
@@ -401,6 +402,9 @@ function hrefToUrl(href) {
401
402
  var transformUrlAndData = (href, data, method, forceFormData, queryStringArrayFormat) => {
402
403
  let url = typeof href === "string" ? hrefToUrl(href) : href;
403
404
  if ((hasFiles(data) || forceFormData) && !isFormData(data)) {
405
+ if (config.get("form.forceIndicesArrayFormatInFormData")) {
406
+ queryStringArrayFormat = "indices";
407
+ }
404
408
  data = objectToFormData(data, new FormData(), null, queryStringArrayFormat);
405
409
  }
406
410
  if (isFormData(data)) {
@@ -1095,6 +1099,14 @@ var objectsAreEqual = (obj1, obj2, excludeKeys) => {
1095
1099
  return false;
1096
1100
  }
1097
1101
  }
1102
+ for (const key in obj2) {
1103
+ if (excludeKeys.includes(key)) {
1104
+ continue;
1105
+ }
1106
+ if (!(key in obj1)) {
1107
+ return false;
1108
+ }
1109
+ }
1098
1110
  return true;
1099
1111
  };
1100
1112
  var compareValues = (value1, value2) => {