@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.
@@ -4111,7 +4111,7 @@ var Utils = (function () {
4111
4111
  this.windowApi = new WindowApi(option);
4112
4112
  }
4113
4113
  /** 版本号 */
4114
- version = "2024.11.6";
4114
+ version = "2024.11.16";
4115
4115
  addStyle(cssText) {
4116
4116
  if (typeof cssText !== "string") {
4117
4117
  throw new Error("Utils.addStyle 参数cssText 必须为String类型");
@@ -4292,9 +4292,17 @@ var Utils = (function () {
4292
4292
  return false;
4293
4293
  }
4294
4294
  }
4295
- cloneFormData(formData) {
4295
+ /**
4296
+ * 复制formData数据
4297
+ * @param formData 需要clone的数据
4298
+ */
4299
+ cloneFormData(formData, filterFn) {
4296
4300
  let clonedFormData = new FormData();
4297
4301
  for (let [key, value] of formData.entries()) {
4302
+ let isFilter = typeof filterFn === "function" ? filterFn(key, value) : false;
4303
+ if (typeof isFilter === "boolean" && isFilter) {
4304
+ continue;
4305
+ }
4298
4306
  clonedFormData.append(key, value);
4299
4307
  }
4300
4308
  return clonedFormData;