typelab / assertions / IsPromise
type IsPromise<T> = _IsTrue<IfPromise<T, true, false>>;Checks if a given type T is a Promise type.
| Type Parameter | Description |
|---|---|
|
|
The type to be checked. |
true if T is a Promise type, false otherwise.
type Valid = IsPromise<Promise<string>>; // true
type Invalid = IsPromise<string>; // false