import { Predicate } from "@siteimprove/alfa-predicate" ; import { Refinement } from "@siteimprove/alfa-refinement" ; import { Role } from "../../role" ; const { equals } = Predicate ; public export function hasName < N extends Role . Name > ( refinement ) ; public export function hasName ( predicate ) ; public export function hasName < N extends Role . Name > ( name , ... rest ) ; export function hasName ( nameOrPredicate , ... names ) { let predicate ; if ( typeof nameOrPredicate === "function" ) { predicate = nameOrPredicate ; } else { predicate = equals ( nameOrPredicate , ... names ) ; } return ( role ) => predicate ( role . name ) ; }