Skip to content

Home > @jview/utils > isPromise

isPromise() function

是否是 Promise 类型

Signature:

typescript
export declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
export declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;

Parameters

ParameterTypeDescription
valunknown

Returns:

val is Promise<T>