Skip to content

Instantly share code, notes, and snippets.

@Willmo36
Created June 25, 2019 15:09
Show Gist options
  • Save Willmo36/1926c8f609a32d2da5b60dcde5072f19 to your computer and use it in GitHub Desktop.
Save Willmo36/1926c8f609a32d2da5b60dcde5072f19 to your computer and use it in GitHub Desktop.
TypeScript MapTo mapped type
export type MapTo<T extends Record<string, V>, K extends keyof V, V> = {
[K2 in keyof T]: T[K2][K]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment