-
zhangwei
2025-03-10 309cc3fe6303d8464951063e89fc9d623915501e
src/common/utils/util.js
@@ -894,5 +894,31 @@
   getFileExtensionWithDotRegex(filename) {
      const match = filename.match(/\.[^.]+$/);
      return match ? match[0] : '';
   },
   isEmpty(value) {
       return (
           value === null ||
           value === undefined ||
           value === '' ||
           (Array.isArray(value) && value.length === 0) ||
           (typeof value === 'object' &&!Array.isArray(value) && Object.keys(value).length === 0)
       );
   },
   removeEmptyValuesRecursive(obj) {
       const newObj = {};
       for (const key in obj) {
           if (obj.hasOwnProperty(key)) {
               const value = obj[key];
               if (!this.isEmpty(value)) {
                   if (typeof value === 'object' &&!Array.isArray(value)) {
                       newObj[key] = removeEmptyValuesRecursive(value);
                   } else {
                       newObj[key] = value;
                   }
               }
           }
       }
       return newObj;
   }
}