shoelace/scripts/shared.js

19 wiersze
430 B
JavaScript

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