@strapi/utils
Version:
Shared utilities for the Strapi packages
21 lines (18 loc) • 605 B
JavaScript
;
const visitor = ({ schema, key, value }, { set })=>{
if (key === '' && value === '*') {
const { attributes } = schema;
const newPopulateQuery = Object.entries(attributes).filter(([, attribute])=>[
'relation',
'component',
'media',
'dynamiczone'
].includes(attribute.type)).reduce((acc, [key])=>({
...acc,
[key]: true
}), {});
set('', newPopulateQuery);
}
};
module.exports = visitor;
//# sourceMappingURL=expand-wildcard-populate.js.map