Files
SnowLuma/.pnpm-store/v11/files/47/59c02ceecc7994f877cc9e2b540c5d2ef4c29d3f52e27eb58de1629570298b5061f0f2cca9f3c1b7ec1b110efec44199d6d80fd19a0683ba199df27716d321
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

24 lines
757 B
Plaintext

export type AsyncFunction<Args extends any[] = any[], Result = void> = (...args: Args) => Promise<Result>;
/**
* Check if value is an async function
*
* 校验是否为异步函数
*
* @example
* ```js
* import { isAsyncFunction } from 'is-what-type';
*
* isAsyncFunction(async () => { }); // true
* isAsyncFunction(() => { }); // false
* isAsyncFunction(function() { }); // false
* isAsyncFunction(async function() { }); // true
* isAsyncFunction(123); // false
* isAsyncFunction('string'); // false
* isAsyncFunction({}); // false
* ```
*
* @param value - The value to check
* @returns `true` if `value` is an async function, `false` otherwise
*/
export declare function isAsyncFunction<T = AsyncFunction>(value: unknown): value is T;