mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-11 09:35:49 +02:00
Shorten the createActionsMap helper in the src/scripting_api/common.js file
This commit is contained in:
parent
d9b81b5199
commit
d236b517fe
@ -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