@fallen-zero/use
Version:
25 lines (24 loc) • 1.14 kB
TypeScript
/** 判断是否为函数 */
export declare const isFunction: (val: any) => val is (...args: any[]) => any;
/** 判断是否为对象 */
export declare const isObject: (val: any) => val is Record<string | number | symbol, any>;
/** 判断是否为数组 */
export declare const isArray: (val: any) => val is any[];
/** 判断是否为字符串 */
export declare const isString: (val: any) => val is string;
/** 判断是否为数字 */
export declare const isNumber: (val: any) => val is number;
/** 判断是否为布尔值 */
export declare const isBoolean: (val: any) => val is boolean;
/** 判断是否为日期 */
export declare const isDate: (val: any) => val is Date;
/** 判断是否为正则表达式 */
export declare const isRegExp: (val: any) => val is RegExp;
/** 判断是否为 undefined */
export declare const isUndefined: (val: any) => val is undefined;
/** 判断是否为 null */
export declare const isNull: (val: any) => val is null;
/** 判断是否为Promise函数 */
export declare const isPromise: (val: any) => val is Promise<any>;
/** 判断是否为文件 */
export declare const isFile: (val: any) => val is File;