getDirectChildByClass = (elem, className) => {
  const children = Array.from(elem.children)
  for (let i = 0; i < children.length; i++) {
    const child = children[i]
    if (child instanceof HTMLElement && hasClass(child, className)) {
      return child
    }
  }
}
Get direct child of an element by class name

@param {HTMLElement} elem
@param {string} className
@returns {HTMLElement | undefined}