"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Find all nodes as a flat list under a certain DOM element
* Reference: https://stackoverflow.com/questions/10730309/find-all-text-nodes-in-html-page
*
* @param el
* @category dom
* @module getDOMNodesUnder
*/
function getDOMNodesUnder(el,
/**
* Any value of NodeFilter. See: https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker
*/
whatToShow) {
if (whatToShow === void 0) { whatToShow = NodeFilter.SHOW_ALL; }
var n = null;
var nodes = [];
var walker = document.createTreeWalker(el, whatToShow, null);
while ((n = walker.nextNode()))
nodes.push(n);
return nodes;
}
exports.default = getDOMNodesUnder;
Source