SelectArray type
Ha TFields
soha nem, akkor egy nem beírt sztringtömb Ellenkező esetben egy keskenyített Fields[]
típus, amelyet a fogyasztó típus más részén kell használni.
type SelectArray<TFields> = [string] extends [TFields]
? readonly TFields[]
: () => (T extends TFields ? true : false) extends () => T extends never
? true
: false
? readonly string[]
: readonly TFields[]