SelectArray type
If TFields
is never, an untyped string array
Otherwise, a narrowed Fields[]
type to be used elsewhere in the consuming type.
type SelectArray<TFields> = [string] extends [TFields]
? readonly TFields[]
: () => (T extends TFields ? true : false) extends () => T extends never
? true
: false
? readonly string[]
: readonly TFields[]