@base-web-kits/base-tools-web 1.1.18-alpha.0 → 1.1.18-alpha.1

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
@@ -1836,7 +1836,7 @@ function toFormData(data) {
1836
1836
  }
1837
1837
 
1838
1838
  // src/web/async/index.ts
1839
- function promisifyWebApi(webApi, apiName) {
1839
+ function enhanceWebApi(webApi, apiName) {
1840
1840
  return (option, config) => {
1841
1841
  const finalConfig = config || {};
1842
1842
  const {
@@ -1851,7 +1851,7 @@ function promisifyWebApi(webApi, apiName) {
1851
1851
  showLoading: showLoadingFn,
1852
1852
  hideLoading: hideLoadingFn
1853
1853
  } = getBaseToolsConfig();
1854
- const fname = apiName || "promisifyWebApi";
1854
+ const fname = apiName || "enhanceWebApi";
1855
1855
  if (showLoading) {
1856
1856
  const title = typeof showLoading === "string" ? showLoading : "";
1857
1857
  showLoadingFn == null ? void 0 : showLoadingFn({ title });
@@ -1931,17 +1931,14 @@ function upload(option, config) {
1931
1931
  data.append(name, file);
1932
1932
  if (formData) {
1933
1933
  Object.entries(formData).forEach(([k, v]) => {
1934
- if (v !== void 0) data.append(k, String(v));
1934
+ if (v !== void 0 && v !== null) data.append(k, String(v));
1935
1935
  });
1936
1936
  }
1937
1937
  xhr.send(data);
1938
1938
  });
1939
1939
  }
1940
1940
  function uploadFile(option, config) {
1941
- return promisifyWebApi(upload, "uploadFile")(
1942
- option,
1943
- config
1944
- );
1941
+ return enhanceWebApi(upload, "uploadFile")(option, config);
1945
1942
  }
1946
1943
 
1947
1944
  // src/web/storage/index.ts