import { Node } from "@siteimprove/alfa-aria" ; import { Device } from "@siteimprove/alfa-device" ; import { Element } from "@siteimprove/alfa-dom" ; import { Predicate } from "@siteimprove/alfa-predicate" ; export function hasHeadingLevel ( device , predicate = ( n ) => ! isNaN ( n ) ) { return ( element ) => Node . from ( element , device ) . attribute ( "aria-level" ) . map ( ( level ) => Number ( level . value ) ) . some ( predicate ) ; }