Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
wcTags.forEach((el, elIndex) => {
const metaData = customElements.tags.find(tag => tag.name.toUpperCase() === el.tagName);
elementUpdated(el).then(() => {
if (metaData && metaData.properties) {
propertiesToKnobs({ el, elIndex, metaData, hasMultiple, filterProperties });
}
if (!filterProperties && metaData && metaData.cssProperties) {
cssPropertiesToKnobs(el, elIndex, metaData.cssProperties, hasMultiple);
}
});
if (metaData) {
const defaultEventNames = ['click', 'focusin', 'focusout', 'keyup'];
const userEventNames = metaData.events ? metaData.events.map(item => item.name) : [];
const uniqueEventNames = [...new Set([...defaultEventNames, ...userEventNames])];
uniqueEventNames.forEach(evName => {
el.addEventListener(evName, () => {
syncElToKnobs(el, elIndex, metaData, hasMultiple, filterProperties);
});