Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 483 Bytes

File metadata and controls

42 lines (30 loc) · 483 Bytes

typelab / utils / ExcludeUndefined

type ExcludeUndefined<T> = Exclude<T, undefined>;

Exclude undefined from type T.

Type Parameters

Type Parameter Description

T

The original type.

Returns

T without `undefined.

Example

type NonUndefinedType = ExcludeUndefined<string | undefined>; // string