Files
NapCatQQ/.pnpm-store/v3/files/19/4c92acad9b2718f697f32dce02849c2f7032a96cfd6fba14013561dbe546c7bf18ebb2b0f53bb03125b12784f7790eaaef6feeb1cfbe10d81bae51e5a56512
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

26 lines
801 B
Plaintext

/**
* Check if the value is a Promise-like object.
*
* 校验是否是一个 Promise-like 对象
*
* @example
* ```js
* import { isPromiseLike } from 'is-what-type';
*
* isPromiseLike(null); // false
* isPromiseLike(undefined); // false
* isPromiseLike({}); // false
* isPromiseLike(new Promise(() => { })); // true
* isPromiseLike({ then: () => { }, catch: () => { } }); // true
* isPromiseLike({ then: () => { } }); // true
* isPromiseLike({ catch: () => { } }); // false
* isPromiseLike('string'); // false
* isPromiseLike(123); // false
* isPromiseLike(function() {}); // false
* ```
*
* @param value - The value to check
* @returns `true` if the value is a Promise-like object, `false` otherwise
*/
export declare function isPromiseLike<T = unknown>(value: T): value is T;