@whitesev/utils 2.5.0 → 2.5.2
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.amd.js +10 -2
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +10 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +10 -2
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +10 -2
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +10 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Httpx.d.ts +1 -1
- package/dist/types/src/Utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/Httpx.ts +1 -1
- package/src/Utils.ts +11 -4
package/dist/index.umd.js
CHANGED
|
@@ -4114,7 +4114,7 @@
|
|
|
4114
4114
|
this.windowApi = new WindowApi(option);
|
|
4115
4115
|
}
|
|
4116
4116
|
/** 版本号 */
|
|
4117
|
-
version = "2024.11.
|
|
4117
|
+
version = "2024.11.16";
|
|
4118
4118
|
addStyle(cssText) {
|
|
4119
4119
|
if (typeof cssText !== "string") {
|
|
4120
4120
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|
|
@@ -4295,9 +4295,17 @@
|
|
|
4295
4295
|
return false;
|
|
4296
4296
|
}
|
|
4297
4297
|
}
|
|
4298
|
-
|
|
4298
|
+
/**
|
|
4299
|
+
* 复制formData数据
|
|
4300
|
+
* @param formData 需要clone的数据
|
|
4301
|
+
*/
|
|
4302
|
+
cloneFormData(formData, filterFn) {
|
|
4299
4303
|
let clonedFormData = new FormData();
|
|
4300
4304
|
for (let [key, value] of formData.entries()) {
|
|
4305
|
+
let isFilter = typeof filterFn === "function" ? filterFn(key, value) : false;
|
|
4306
|
+
if (typeof isFilter === "boolean" && isFilter) {
|
|
4307
|
+
continue;
|
|
4308
|
+
}
|
|
4301
4309
|
clonedFormData.append(key, value);
|
|
4302
4310
|
}
|
|
4303
4311
|
return clonedFormData;
|