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