Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 444 Bytes

File metadata and controls

42 lines (30 loc) · 444 Bytes

typelab / utils / ExcludeNull

type ExcludeNull<T> = Exclude<T, null>;

Exclude null from type T.

Type Parameters

Type Parameter Description

T

The original type.

Returns

T without null.

Example

type NonNullType = ExcludeNull<string | null>; // string