import { Predicate } from "@siteimprove/alfa-predicate" ; import { Name } from "../../name" ; import { Node } from "../../node" ; public export function hasName ( predicate ? ) ; public export function hasName ( name , ... rest ) ; export function hasName ( nameOrPredicate = ( ) => true , ... names ) { let predicate ; if ( typeof nameOrPredicate === "function" ) { predicate = nameOrPredicate ; } else { predicate = Name . hasValue ( nameOrPredicate , ... names ) ; } return ( node ) => node . name . some ( predicate ) ; }