Some basic components for building forms.

This commit is contained in:
Tomas Bures 2017-06-04 13:16:29 +02:00
parent d13fc65ce2
commit 4504d539c5
22 changed files with 827 additions and 246 deletions

View file

@ -23,7 +23,8 @@ module.exports = {
injectCustomFormTemplates,
filterCustomFields,
getMjmlTemplate,
rollbackAndReleaseConnection
rollbackAndReleaseConnection,
filterObject
};
function getDefaultMergeTags(callback) {
@ -293,3 +294,14 @@ function rollbackAndReleaseConnection(connection, callback) {
return callback();
});
}
function filterObject(obj, allowedKeys) {
const result = {};
for (const key in obj) {
if (allowedKeys.has(key)) {
result[key] = obj[key];
}
}
return result;
}