"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.removeNestedEmptyEls = removeNestedEmptyEls;
/**
 * Walks up DOM removing elements if they are empty until it finds
 * one that is not
 */
function removeNestedEmptyEls(el) {
  while (el.parentElement && el.childElementCount === 0 && el.textContent === '') {
    var parentEl = el.parentElement;
    parentEl.removeChild(el);
    el = parentEl;
  }
}