refactor: upgrade project setup (#646)

This commit is contained in:
三咲智子 Kevin Deng
2023-06-22 12:14:02 +08:00
committed by GitHub
parent 687be8aca8
commit dbba3205e4
53 changed files with 6861 additions and 12397 deletions

View File

@ -0,0 +1,4 @@
declare function transformOn(
obj: Record<string, any>
): Record<`on${string}`, any>;
export default transformOn;

View File

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

View File

@ -4,5 +4,6 @@
"description": "to help transform on",
"author": "Amour1688 <lcz_1996@foxmail.com>",
"license": "MIT",
"main": "index.js"
"main": "index.js",
"types": "index.d.ts"
}