@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/async/index.d.ts +6 -6
- package/dist/async/index.d.ts.map +1 -1
- package/dist/base-tools-web.umd.global.js +4 -7
- package/dist/base-tools-web.umd.global.js.map +1 -1
- package/dist/index.cjs +4 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/dist/network/uploadFile.d.ts +1 -1
- package/dist/network/uploadFile.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/web/async/index.ts +10 -7
- package/src/web/network/uploadFile.ts +4 -10
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
|
|
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 || "
|
|
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
|
|
1942
|
-
option,
|
|
1943
|
-
config
|
|
1944
|
-
);
|
|
1941
|
+
return enhanceWebApi(upload, "uploadFile")(option, config);
|
|
1945
1942
|
}
|
|
1946
1943
|
|
|
1947
1944
|
// src/web/storage/index.ts
|