Skip to content

Commit d236b51

Browse files
committed
Shorten the createActionsMap helper in the src/scripting_api/common.js file
1 parent d9b81b5 commit d236b51

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/scripting_api/common.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ const FieldType = {
2222
};
2323

2424
function createActionsMap(actions) {
25-
const actionsMap = new Map();
26-
if (actions) {
27-
for (const [eventType, actionsForEvent] of Object.entries(actions)) {
28-
actionsMap.set(eventType, actionsForEvent);
29-
}
30-
}
31-
return actionsMap;
25+
return new Map(actions ? Object.entries(actions) : null);
3226
}
3327

3428
function getFieldType(actions) {

0 commit comments

Comments
 (0)