packages/basic-component-mixins/src/safeAttributes.js
function setAttributeToElement(element, attributeName, value) {
  if (value === null || typeof value === 'undefined') {
    element.removeAttribute(attributeName);
  } else {
    const text = String(value);
    // Avoid recursive attributeChangedCallback calls.
    if (element.getAttribute(attributeName) !== text) {
      element.setAttribute(attributeName, value);
    }
  }
}
function setAttributeToElement(element, attributeName, value) {
  if (value === null || typeof value === 'undefined') {
    element.removeAttribute(attributeName);
  } else {
    const text = String(value);
    // Avoid recursive attributeChangedCallback calls.
    if (element.getAttribute(attributeName) !== text) {
      element.setAttribute(attributeName, value);
    }
  }
}
function setAttributeToElement ( element , attributeName , value ) { if ( value === null || typeof value === 'undefined' ) { element . removeAttribute ( attributeName ) ; } else { const text = String ( value ) ; // Avoid recursive attributeChangedCallback calls. if ( element . getAttribute ( attributeName ) !== text ) { element . setAttribute ( attributeName , value ) ; } } }
Reflect the attribute to the given element. If the value is null, remove the attribute.
Reflect the attribute to the given element . If the value is null remove the attribute .