import { Node } from 'typescript' ; import { findMatches } from '../match' ; import { traverseChildren } from '../traverse' ; import { TSQueryOptions , TSQuerySelectorNode } from '../tsquery-types' ; export function has ( node , selector , _ , options ) { const collector = [ ] ; selector . selectors . forEach ( childSelector => { traverseChildren ( node , ( childNode , ancestry ) => { if ( findMatches ( childNode , childSelector , ancestry ) ) { collector . push ( childNode ) ; } } , options ) ; } ) ; return collector . length > 0 ; }