Skip to content

Commit 521c1f0

Browse files
committed
Add support for passing any node in types
1 parent 2dd9754 commit 521c1f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
2-
* @typedef {import('hast').Element} HastElement
2+
* @typedef {import('hast').Parent} Parent
3+
* @typedef {import('hast').Root} Root
4+
* @typedef {Root|Parent['children'][number]} Node
35
*/
46

57
/**
68
* Rank of a heading: H1 -> 1, H2 -> 2, etc.
79
*
8-
* @param {HastElement} node
10+
* @param {Node} node
911
* @returns {number|null}
1012
*/
1113
export function headingRank(node) {

0 commit comments

Comments
 (0)