doit = {
const doit_ = (attrs) => {
const att = _(attrs);
const result = {
standard: att
.pickBy((v) => types.standard.includes(v.type))
.keys()
.value(),
inline: att
.pickBy((v) => types.inline.includes(v.type))
.keys()
.value(),
components: att
.pickBy((v) => v.type === "component")
.mapValues((v) => cmpts[v.component].attributes)
.mapValues((attr) => doit_(attr))
.value()
};
return _.pickBy(result, (v) => _.keys(v).length > 0);
};
return doit_;
}