We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43f91c7 commit f68de5cCopy full SHA for f68de5c
index.js
@@ -1,13 +1,17 @@
1
/**
2
- * @typedef {import('hast').Element & {tagName: 'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'hgroup'}} Heading
3
- * @typedef {import('hast-util-is-element').AssertPredicate<Heading>} AssertHeading
+ * @typedef {import('hast').Element} Element
4
*/
5
6
import {convertElement} from 'hast-util-is-element'
7
8
9
* Check if a node is a heading element (includes `hgroup`!).
10
- * @type {AssertHeading}
+ *
+ * @type {import('hast-util-is-element').AssertPredicate<Element & {tagName: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hgroup'}>}
11
+ * @param node
12
+ * Node to check.
13
+ * @returns
14
+ * Whether node is a heading (`h1` through `h6`, and `hgroup`).
15
16
// @ts-expect-error Sure, the assertion matches.
17
export const heading = convertElement([
0 commit comments