Skip to content

Instantly share code, notes, and snippets.

@navin-moorthy
Last active June 27, 2023 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navin-moorthy/aabb640452be2e4dcd4693e242fbcfa4 to your computer and use it in GitHub Desktop.
Save navin-moorthy/aabb640452be2e4dcd4693e242fbcfa4 to your computer and use it in GitHub Desktop.
Typescript Utils
export type KeysOfValue<T, TCondition = string> = {
[K in keyof T]: T[K] extends TCondition ? K : never;
}[keyof T];
// 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