const hasClass = ( element , className ) => { return element . classList . contains ( className ) ; } ; export const hasClassInTree = ( element , className ) : boolean => { if ( ! element . parentElement ) { return false ; } if ( hasClass ( element , className ) ) { return true ; } return hasClassInTree ( element . parentElement , className ) ; } ;