import Types from './types'; import Str from './string'; /** * DOM utilities */ export default { /** * Returns text + text of children of given node * @param {NodeElement} node * @return {String} */ getText(node){ if(Types.isUndef(node.textContent)) { return Str.trim(node.innerText); } return Str.trim(node.textContent); }, /** * 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