/** * DOM utilities */ export default { /** * Returns text + text of children of given node * @param {NodeElement} node * @return {String} */ getText(node){ let s = node.textContent || node.innerText || node.innerHTML.replace(/<[^<>]+>/g, ''); s = s.replace(/^\s+/, '').replace(/\s+$/, ''); return s; }, /** * Returns the first text node contained in the supplied node * @param {NodeElement} node node * @return {String} */ getFirstTextNode(node){ for(let i=0; i 1){ for(let i=0; i