Browse Source

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

wangcong 2 tuần trước cách đây
mục cha
commit
336d708acc
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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;
 };