mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-22 16:05:56 +02:00
Merge pull request #20820 from Snuffleupagus/createActionsMap-shorten
Shorten the `createActionsMap` helper in the `src/scripting_api/common.js` file
This commit is contained in:
commit
a3a13f6041
@ -22,13 +22,7 @@ const FieldType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function createActionsMap(actions) {
|
function createActionsMap(actions) {
|
||||||
const actionsMap = new Map();
|
return new Map(actions ? Object.entries(actions) : null);
|
||||||
if (actions) {
|
|
||||||
for (const [eventType, actionsForEvent] of Object.entries(actions)) {
|
|
||||||
actionsMap.set(eventType, actionsForEvent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return actionsMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFieldType(actions) {
|
function getFieldType(actions) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user