mirror of
https://github.com/strapi/strapi.git
synced 2025-08-02 05:48:39 +00:00
19 lines
441 B
JavaScript
19 lines
441 B
JavaScript
'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)
|
|
);
|
|
}
|
|
|
|
const isComponent = (def, key) =>
|
|
['component', 'dynamiczone'].includes(def.attributes[key].type);
|
|
|
|
module.exports = {
|
|
getComponentAttributes,
|
|
isComponent,
|
|
};
|