wujingjing
2024-06-25 bcf1b7b22909b8c0318bfb57c9cc65f97312d868
1
2
3
4
5
6
7
8
9
10
11
import { isNil } from 'lodash-unified';
 
export const isUndefined = (val: any): val is undefined => val === undefined;
export const isBoolean = (val: any): val is boolean => typeof val === 'boolean';
export const isNumber = (val: any): val is number => typeof val === 'number';
 
export const isPropAbsent = (prop: unknown): prop is null | undefined => {
    return isNil(prop);
};
 
export const isFilledArray = (val: any) => Array.isArray(val) && val.length > 0;