@zstings/utils
Version:
javascript、typescript 工具函数库 文档地址 [utils 文档](https://zstings.github.io/utils/)
23 lines (22 loc) • 424 B
TypeScript
/**
* 判断是否为Promise
* @param value 任意值
* @return true | false
* @category 工具Util
* @example
* 验证通过
* ```ts
* isPromise(new Promise(() => {})) => true
* isPromise(Promise.all([])) => true
* ```
* @example
* 验证失败
* ```ts
* isPromise(Promise) => false
* ```
* @example
* ```ts
* isPromise(Promise) => false
* ```
*/
export default function isPromise(value: any): boolean;