Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extractProps: tagName => {
const customElements = getCustomElements();
if (isValidComponent(tagName) && isValidMetaData(customElements)) {
const metaData = customElements.tags.find(
tag => tag.name.toUpperCase() === tagName.toUpperCase()
);
const sections = {};
if (metaData.attributes) {
sections.attributes = mapData(metaData.attributes);
}
if (metaData.properties) {
sections.props = mapData(metaData.properties);
}
if (metaData.events) {
sections.events = mapData(metaData.events);
}
if (metaData.slots) {
sections.slots = mapData(metaData.slots);
}