Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 534 Bytes

File metadata and controls

43 lines (31 loc) · 534 Bytes

typelab / assertions / IsString

type IsString<T> = _IsTrue<IfString<T, true, false>>;

Checks if a given type T is a string.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T is a string, false otherwise.

Example

type Valid = IsString<string>; // true
type Invalid = IsString<number>; // false