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 / IsFunction

type IsFunction<T> = _IsTrue<IfFunction<T, true, false>>;

Checks if a given type T is a function type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a function type, false otherwise.

Example

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