typelab / assertions / IsAsyncFunction
type IsAsyncFunction<T> = _IsTrue<IfAsyncFunction<T, true, false>>;Checks if a given type T is an async function type.
| Type Parameter | Description |
|---|---|
|
|
The type to be checked. |
true if T is an async function type, false otherwise.
type Valid = IsAsyncFunction<() => Promise<string>>; // true
type Invalid = IsAsyncFunction<() => string>; // false