SelectArray type
如果 TFields 从不为类型化字符串数组,则为非类型化字符串数组;否则,将使用类型中的其他位置使用的窄 Fields[] 类型。
type SelectArray<TFields> = [string] extends [TFields]
? readonly TFields[]
: () => (T extends TFields ? true : false) extends () => T extends never
? true
: false
? readonly string[]
: readonly TFields[]