Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getAttributeInfosForElement(info, elementName, element) {
var attributes = [];
// Add html attributes
var htmlAttributes = html_info_1.attributeNames(elementName) || [];
if (htmlAttributes) {
attributes.push.apply(attributes, tslib_1.__spread(htmlAttributes.map(function (name) { return ({ name: name, fromHtml: true }); })));
}
// Add html properties
var htmlProperties = html_info_1.propertyNames(elementName);
if (htmlProperties) {
attributes.push.apply(attributes, tslib_1.__spread(htmlProperties.map(function (name) { return ({ name: name, input: true }); })));
}
// Add html events
var htmlEvents = html_info_1.eventNames(elementName);
if (htmlEvents) {
attributes.push.apply(attributes, tslib_1.__spread(htmlEvents.map(function (name) { return ({ name: name, output: true }); })));
}
var _a = utils_1.getSelectors(info), selectors = _a.selectors, selectorMap = _a.map;
if (selectors && selectors.length) {
// All the attributes that are selectable should be shown.
var applicableSelectors = selectors.filter(function (selector) { return !selector.element || selector.element == elementName; });
var selectorAndAttributeNames = applicableSelectors.map(function (selector) { return ({ selector: selector, attrs: selector.attrs.filter(function (a) { return !!a; }) }); });
var attrs_1 = utils_1.flatten(selectorAndAttributeNames.map(function (selectorAndAttr) {
var directive = selectorMap.get(selectorAndAttr.selector);
var result = selectorAndAttr.attrs.map(function (name) { return ({ name: name, input: name in directive.inputs, output: name in directive.outputs }); });