const insideElement = ( target , wrap ) : boolean => { let node = target ; while ( node ) { if ( node === wrap ) return true ; node = node . parentElement as Element ; } return false ; } ; export default insideElement ;