19 lines
441 B
JavaScript
Raw Normal View History

2019-10-24 14:07:41 +02:00
'use strict';
/**
* Returns the attribute keys of the component related attributes
*/
function getComponentAttributes(definition) {
return Object.keys(definition.attributes).filter(key =>
['component', 'dynamiczone'].includes(definition.attributes[key].type)
2019-10-24 14:07:41 +02:00
);
}
const isComponent = (def, key) =>
['component', 'dynamiczone'].includes(def.attributes[key].type);
2019-10-24 14:07:41 +02:00
module.exports = {
getComponentAttributes,
isComponent,
2019-10-24 14:07:41 +02:00
};