typelab / utils / ExcludeNullish
type ExcludeNullish<T> = Exclude<T, null | undefined>;Exclude null and undefined from type T.
| Type Parameter | Description |
|---|---|
|
|
The original type. |
T without null and `undefined.
type NonNullishType = ExcludeNullish<string | null | undefined>; // string