Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 614 Bytes

File metadata and controls

43 lines (31 loc) · 614 Bytes

typelab / assertions / IsAsyncFunction

type IsAsyncFunction<T> = _IsTrue<IfAsyncFunction<T, true, false>>;

Checks if a given type T is an async function type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is an async function type, false otherwise.

Example

type Valid = IsAsyncFunction<() => Promise<string>>; // true
type Invalid = IsAsyncFunction<() => string>; // false