Last active
July 10, 2020 20:36
-
-
Save ivawzh/693aced4f5a0a84c6a057cd56082ad1e to your computer and use it in GitHub Desktop.
TS-TypeUtils
This file contains hidden or 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 TransformObjValueType<OBJ extends {[k: string]: string}, NEW_TYPE> = | |
{[K in keyof OBJ]: NEW_TYPE} | |
// Usage: | |
type Secrets = {[k: string]: string} | |
type ContainerSecrets = TransformObjValueType<Secrets, EcsSecret> | |
// now type ContainerSecrets = {[k: string]: EcsSecret} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment