File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @typedef {import('hast').Root } Root
3
- * @typedef {Root['children'][number]|Root } Node
3
+ * @typedef {import('hast').Content } Content
4
+ */
5
+
6
+ /**
7
+ * @typedef {Content | Root } Node
4
8
*/
5
9
6
10
/**
7
11
* Check whether a `node` is labelable:
8
- * See: <https://html.spec.whatwg.org/#category-label>.
12
+ * See: <https://html.spec.whatwg.org/multipage/forms.html #category-label>.
9
13
*
10
14
* @param {Node } node
15
+ * Node to check (typically `Element`).
11
16
* @returns {boolean }
17
+ * Whether `node` is a labelable element.
12
18
*/
13
19
export function labelable ( node ) {
14
20
return Boolean (
Original file line number Diff line number Diff line change 27
27
28
28
## What is this?
29
29
30
- This package is a small utility that checks if a node is labelable according to
31
- HTML.
30
+ This package is a small utility that checks if a node is a labelable element
31
+ according to HTML.
32
32
33
33
## When should I use this?
34
34
@@ -206,7 +206,7 @@ abide by its terms.
206
206
207
207
[ coc ] : https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
208
208
209
- [ spec ] : https://html.spec.whatwg.org/#category-label
209
+ [ spec ] : https://html.spec.whatwg.org/multipage/forms.html #category-label
210
210
211
211
[ hast ] : https://github.com/syntax-tree/hast
212
212
You can’t perform that action at this time.
0 commit comments