How can I take a type like,
type A = string[]
and get it's singular version, string?
Put another way, how can I construct a ArrayDeref utility type that takes a generic Array and extracts what it is an array of.
type ASingular = ArrayDeref<A>
// ASingular = string
CodePudding user response:
type ArrayDeref<T extends unknown[]> = T[number]
