Skip to content

Instantly share code, notes, and snippets.

@stackdumper
Last active March 28, 2019 21:32
Show Gist options
  • Save stackdumper/7804a9fdbc8c9c938aedf1eb019a2676 to your computer and use it in GitHub Desktop.
Save stackdumper/7804a9fdbc8c9c938aedf1eb019a2676 to your computer and use it in GitHub Desktop.
type Replace<Target extends Record<string, any>, Value extends any> = {
[Key in keyof Target]: Target[Key] extends object
? Replace<Target[Key], Value>
: Value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment