Преглед на файлове

chore(utils): 添加判断空值的函数

wangcong преди 2 седмици
родител
ревизия
336d708acc
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/utils/index.ts

+ 4 - 0
src/utils/index.ts

@@ -265,6 +265,10 @@ export const calcPercentage = (currentValue?: number, maxValue?: number) => {
   return Number(percentage.toFixed(2));
 };
 
+export const isEmptyVal = (value: unknown) => {
+  return value === undefined || value === null;
+};
+
 export const isNotEmptyVal = (value: unknown) => {
   return value !== undefined && value !== null;
 };