Skip to content

Commit a3a13f6

Browse files
Merge pull request #20820 from Snuffleupagus/createActionsMap-shorten
Shorten the `createActionsMap` helper in the `src/scripting_api/common.js` file
2 parents d9b81b5 + d236b51 commit a3a13f6

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)