Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 576 Bytes

File metadata and controls

43 lines (31 loc) · 576 Bytes

typelab / assertions / IsUndefinable

type IsUndefinable<T> = IfUndefinable<T, true, false>;

Checks if a given type T has undefined type.

Type Parameters

Type Parameter Description

T

The type to be checked.

Returns

true if T has undefined type, false otherwise.

Example

type Valid = IsUndefinable<string | undefined>; // true
type Invalid = IsUndefinable<string>; // false