isAsync
It detects if a function is asynchronous.
Types
IsAsyncProps
@templateT - The argument tuple type of the function, whenfnis callable.@templateE - The return or resolved value type.
Parameters accepted by isAsync.
| Property | Type | Required | Description |
|---|---|---|---|
fn | E \| Promise<E> \| ((...args: T) => E \| Promise<E>) | ✓ | The value to inspect. Accepts: - A plain value of type E — considered synchronous. - A Promise<E> — considered asynchronous. - A function (...args: T) => E | Promise<E> — considered asynchronous if the function is declared async or its toString() representation contains the async keyword. |
