Created
March 13, 2020 01:27
-
-
Save ksaldana1/0db06a69954c6cd4432202b4be550e9c to your computer and use it in GitHub Desktop.
ts_example_4_fix
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
function premiumColor(role: USER_ROLE) { | |
switch (role) { | |
case "PREMIUM": { | |
return "red"; | |
} | |
case "WHALE": { | |
return "blue"; | |
} | |
case "FREE": { | |
return "black"; | |
} | |
case "%future added value": { | |
return "black"; | |
} | |
default: { | |
assertNever(role); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment