Type Alias PickByValue<T, V>

PickByValue<T, V>: {
    [P in keyof T as T[P] extends V
        ? P
        : never]: T[P]
}

Like Pick, but constructs the type based on the values.

Type Parameters

  • T
  • V