Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. /**
  2. * Example:
  3. *
  4. * Input: keys = ['GET_USER', 'GET_INFO']
  5. * Returns: { GET_USER: 'GET_USER', GET_INFO: 'GET_INFO' }
  6. */
  7. const reflectKeys = (keys = [], prefix = "") => {
  8. const obj = {};
  9.  
  10. keys.forEach(key => {
  11. const value = `${prefix}${key}`;
  12. obj[key] = value;
  13. });
  14. return obj;
  15. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement