Last active
June 27, 2023 07:12
-
-
Save navin-moorthy/aabb640452be2e4dcd4693e242fbcfa4 to your computer and use it in GitHub Desktop.
Typescript Utils
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
export type KeysOfValue<T, TCondition = string> = { | |
[K in keyof T]: T[K] extends TCondition ? K : never; | |
}[keyof T]; |
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
// https://twitter.com/mattpocockuk/status/1622730173446557697 | |
export type Prettify<T> = { | |
[P in keyof T]: T[P]; | |
} & {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment