safeAttr = (name, value) => {
  name = safeAttrName(name)
  let valString

  if (value) {
    if (Array.isArray(value)) {
      valString = escapeAttr(value.join(' '))
    } else {
      if (typeof value === 'boolean') {
        value = value.toString()
      }
      valString = escapeAttr(value.trim())
    }
  }

  value = value ? `="${valString}"` : ''
  return {
    name,
    value,
  }
}
Convert attributes to markup safe strings
@param  {string} name  attribute name
@param  {string} value attribute value
@return {Object}       {attrName: attrValue}