ValueFromArray
Extracts the generic value from an Array type.
If you have T extends Array<any>
, and pass a string[]
to it,
ValueFromArray<T>
will return the actual type of string
.
type ValueFromArray<A extends readonly unknown[]> = A extends Array<infer T> ? T : never;