code: function cleanAttrs (el, attrs, styles) {  // attrs === false - remove all, attrs === true - allow all
    if (attrs === true) { return; }
  
    Array.prototype.slice.call(el.attributes)
      .forEach(function (attr) {
        // remove if it is not style nor on attrs  whitelist
        // keeping attributes that are also styles because attributes override
        if (attr.specified) {
          if (attrs === '' || attrs === false || (isUndefined(styles[attr.name]) && attrs.indexOf(attr.name) < 0)) {
            el.removeAttribute(attr.name);
          }
        }
      });
  }
docs: Removes attributes that are not valid for SVGs