vtils

Home > types > Defined

Defined type

去除类型 T 中的 undefined。

Signature:

export declare type Defined<T> = Exclude<T, undefined>;

Example

type X = string | undefined
type Y = Defined<X> // => string