Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 560 Bytes

File metadata and controls

43 lines (31 loc) · 560 Bytes

typelab / assertions / IsPromise

type IsPromise<T> = _IsTrue<IfPromise<T, true, false>>;

Checks if a given type T is a Promise type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a Promise type, false otherwise.

Example

type Valid = IsPromise<Promise<string>>; // true
type Invalid = IsPromise<string>; // false