license param element param excludeSelector export function _getTextWithExcludedElements ( element , excludeSelector ) { const clone = element . cloneNode ( true ) as Element ; const exclusions = clone . querySelectorAll ( excludeSelector ) ; for ( let i = 0 ; i < exclusions . length ; i ++ ) { exclusions [ i ] . remove ( ) ; } return ( clone . textContent || '' ) . trim ( ) ; }