@base-web-kits/base-tools-web 1.2.10 → 1.3.0

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.cjs CHANGED
@@ -1426,7 +1426,7 @@ function upload(option, config) {
1426
1426
  return new Promise((resolve, reject) => {
1427
1427
  var _a;
1428
1428
  const xhr = new XMLHttpRequest();
1429
- const { url, file, name = "file", header, formData, timeout = 0 } = option;
1429
+ const { url, file, name = "file", header, data, timeout = 0 } = option;
1430
1430
  const fail = (error) => reject(error);
1431
1431
  const success = (responseText) => {
1432
1432
  resolve(responseText);
@@ -1465,14 +1465,14 @@ function upload(option, config) {
1465
1465
  });
1466
1466
  }
1467
1467
  xhr.timeout = timeout;
1468
- const data = new FormData();
1469
- if (formData) {
1470
- Object.entries(formData).forEach(([k, v]) => {
1471
- if (v !== void 0 && v !== null) data.append(k, String(v));
1468
+ const formData = new FormData();
1469
+ if (data) {
1470
+ Object.entries(data).forEach(([k, v]) => {
1471
+ if (v !== void 0 && v !== null) formData.append(k, String(v));
1472
1472
  });
1473
1473
  }
1474
- data.append(name, file);
1475
- xhr.send(data);
1474
+ formData.append(name, file);
1475
+ xhr.send(formData);
1476
1476
  });
1477
1477
  }
1478
1478
  function uploadFile(option, config) {