@eljs/utils
Version:
Collection of nodejs utility.
64 lines • 1.76 kB
TypeScript
/**
* 是否为 undefined
* @param target 目标对象
*/
export declare function isUndefined(target: unknown): target is undefined;
/**
* 是否为 Null
* @param target 目标对象
*/
export declare function isNull(target: unknown): target is undefined;
/**
* 是否为字符串
* @param target 目标对象
*/
export declare function isString(target: unknown): target is string;
/**
* 是否为对象
* @param target 目标对象
*/
export declare function isObject<T = Record<string, unknown>>(target: unknown): target is T;
/**
* 是否为数组
* @param target 目标对象
*/
export declare function isArray<T = Array<unknown>>(target: unknown): target is T;
/**
* 是否为函数
* @param target 目标对象
*/
export declare function isFunction<T = Function>(target: unknown): target is T;
/**
* 是否为布尔值
* @param target 目标对象
*/
export declare function isBoolean(target: unknown): target is boolean;
/**
* 是否为 Object 扩展的对象
* @param target 目标对象
*/
export declare function isPlainObject(target: unknown): target is object;
/**
* 是否为 Promise 实例
* @param target 目标对象
*/
export declare function isPromise<T>(target: unknown): target is Promise<T>;
/**
* 是否为 Generator 函数
* @param target 目标对象
*/
export declare function isGeneratorFunction(target: unknown): target is AsyncGeneratorFunction;
/**
* 是否为 Async 函数
* @param target 目标对象
*/
export declare function isAsyncFunction(target: unknown): target is AsyncGeneratorFunction;
/**
* 是否为 es module
* @param module 模块
*/
export declare function isESModule<T>(module: unknown): module is {
__esModule: true;
default: T;
};
//# sourceMappingURL=index.d.ts.map