Created
March 6, 2020 20:18
-
-
Save FFKL/5820dea6b54581699ccce9404d5f9b28 to your computer and use it in GitHub Desktop.
This type is used to select the field names of the type (T) by the specified type (P).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type OnlyPickedTypeFields<T extends object, P> = { [K in keyof T]: T[K] extends P ? K : never }[keyof T]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment