typelab / utils / ArrayOmitOptional
type ArrayOmitOptional<T> = T extends ReadonlyArray ? _IfNotAnyOrNever<T, _ArrayOmitOptional<T>> : never;Omit the optional elements from T type.
| Type Parameter | Description |
|---|---|
|
|
The |
Array with elements of T that are required.
// [string, string]
type Result = ArrayOmitOptional<[string, string, string?]>;
// never
type Never = ArrayOmitOptional<any>;