assignAttributes = (elem, attrs, suspendLength, unitCheck) => {
  for (const [key, value] of Object.entries(attrs)) {
    const ns =
      key.substr(0, 4) === 'xml:'
        ? NS.XML
        : key.substr(0, 6) === 'xlink:'
          ? NS.XLINK
          : null
    if (value === undefined) {
      if (ns) {
        elem.removeAttributeNS(ns, key)
      } else {
        elem.removeAttribute(key)
      }
      continue
    }
    if (ns) {
      elem.setAttributeNS(ns, key, value)
    } else if (!unitCheck) {
      elem.setAttribute(key, value)
    } else {
      setUnitAttr(elem, key, value)
    }
  }
}
Assigns multiple attributes to an element.
@function module:utilities.assignAttributes
@param {Element} elem - DOM element to apply new attribute values to
@param {PlainObject<string, string>} attrs - Object with attribute keys/values
@param {Integer} [suspendLength] - Milliseconds to suspend redraw
@param {boolean} [unitCheck=false] - Boolean to indicate the need to use units.setUnitAttr
@returns {void}