You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
214 B

3 months ago
  1. const transformOn = (obj) => {
  2. const result = {};
  3. Object.keys(obj).forEach((evt) => {
  4. result[`on${evt[0].toUpperCase()}${evt.slice(1)}`] = obj[evt];
  5. });
  6. return result;
  7. };
  8. module.exports = transformOn;