@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.cjs CHANGED
@@ -1905,7 +1905,7 @@ function toFormData(data) {
1905
1905
  }
1906
1906
 
1907
1907
  // src/web/async/index.ts
1908
- function promisifyWebApi(webApi, apiName) {
1908
+ function enhanceWebApi(webApi, apiName) {
1909
1909
  return (option, config) => {
1910
1910
  const finalConfig = config || {};
1911
1911
  const {
@@ -1920,7 +1920,7 @@ function promisifyWebApi(webApi, apiName) {
1920
1920
  showLoading: showLoadingFn,
1921
1921
  hideLoading: hideLoadingFn
1922
1922
  } = getBaseToolsConfig();
1923
- const fname = apiName || "promisifyWebApi";
1923
+ const fname = apiName || "enhanceWebApi";
1924
1924
  if (showLoading) {
1925
1925
  const title = typeof showLoading === "string" ? showLoading : "";
1926
1926
  showLoadingFn == null ? void 0 : showLoadingFn({ title });
@@ -2000,17 +2000,14 @@ function upload(option, config) {
2000
2000
  data.append(name, file);
2001
2001
  if (formData) {
2002
2002
  Object.entries(formData).forEach(([k, v]) => {
2003
- if (v !== void 0) data.append(k, String(v));
2003
+ if (v !== void 0 && v !== null) data.append(k, String(v));
2004
2004
  });
2005
2005
  }
2006
2006
  xhr.send(data);
2007
2007
  });
2008
2008
  }
2009
2009
  function uploadFile(option, config) {
2010
- return promisifyWebApi(upload, "uploadFile")(
2011
- option,
2012
- config
2013
- );
2010
+ return enhanceWebApi(upload, "uploadFile")(option, config);
2014
2011
  }
2015
2012
 
2016
2013
  // src/web/storage/index.ts