Advertisement
Guest User

Untitled

a guest
May 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. type Countries = 'england' | 'scotland' | 'wales';
  2.  
  3. type Urls = { [country in Countries]: string }
  4.  
  5. const baseUrls: Urls = {
  6.  'england': 'foo',
  7.  'scotland': 'foo',
  8.  'wales': 'foo',
  9. };
  10. const env = 'england';
  11.  
  12. const baseUrl: string = baseUrls[env];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement