Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Example:
- *
- * Input: keys = ['GET_USER', 'GET_INFO']
- * Returns: { GET_USER: 'GET_USER', GET_INFO: 'GET_INFO' }
- */
- const reflectKeys = (keys = [], prefix = "") => {
- const obj = {};
- keys.forEach(key => {
- const value = `${prefix}${key}`;
- obj[key] = value;
- });
- return obj;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement