type-alias
Source: base.ts ↗
Flatten
Flatten array type.
export type Flatten<T> = T extends Array<infer A> ? A : T;
Remarks
If the type is not an array, return the same type. Works only for 1 level, nested array types are not recursively flattened.
Example
number[] is resolved as number
string[][] is resolved as string[]
string is resolved as string