shoelace/scripts/shared.js

19 wiersze
430 B
JavaScript
Czysty Zwykły widok Historia

2021-09-09 13:13:55 +00:00
export function getAllComponents(metadata) {
const allComponents = [];
metadata.modules.map(module => {
module.declarations?.map(declaration => {
if (declaration.customElement) {
const component = declaration;
2021-11-04 11:27:18 +00:00
const modulePath = module.path;
2021-09-09 13:13:55 +00:00
if (component) {
2021-11-04 11:27:18 +00:00
allComponents.push(Object.assign(component, { modulePath }));
2021-09-09 13:13:55 +00:00
}
}
});
});
return allComponents;
}