Files
shoelace/scripts/shared.js
2022-11-10 16:27:23 -05:00

19 lines
418 B
JavaScript

export function getAllComponents(metadata) {
const allComponents = [];
metadata.modules.map(module => {
module.declarations?.map(declaration => {
if (declaration.customElement) {
const component = declaration;
const path = module.path;
if (component) {
allComponents.push(Object.assign(component, { path }));
}
}
});
});
return allComponents;
}