refactor: support transformOn

This commit is contained in:
Amour1688
2020-05-26 21:04:56 +08:00
parent 402568dc52
commit 7a1a39a4cb
19 changed files with 161 additions and 95 deletions

View File

@ -0,0 +1,9 @@
const transformOn = (obj) => {
const result = {};
Object.keys(obj).forEach((evt) => {
result[`on${evt[0].toUpperCase()}${evt.substr(1)}`] = obj[evt];
});
return result;
};
module.exports = transformOn;