8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- [ hast] [ ] utility to check if a node is [ * labelable* ] [ spec ] .
11
+ [ hast] [ ] utility to check if a node is a [ * labelable element * ] [ spec ] .
12
12
13
13
## Contents
14
14
@@ -38,7 +38,7 @@ looking for!
38
38
## Install
39
39
40
40
This package is [ ESM only] [ esm ] .
41
- In Node.js (version 12.20+, 14.14+, 16.0+, or 18 .0+), install with [ npm] [ ] :
41
+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
42
42
43
43
``` sh
44
44
npm install hast-util-labelable
@@ -76,23 +76,24 @@ labelable({
76
76
77
77
## API
78
78
79
- This package exports the identifier ` labelable ` .
79
+ This package exports the identifier [ ` labelable ` ] [ labelable ] .
80
80
There is no default export.
81
81
82
82
### ` labelable(node) `
83
83
84
- Check if the given value is a [ * labelable* ] [ spec ] [ * element* ] [ element ] .
84
+ Check if the given value is a [ * labelable element* ] [ spec ] .
85
85
86
86
###### Parameters
87
87
88
- * ` node ` (` * ` , optional) — Value to check, probably [ ` Node ` ] [ node ]
88
+ * ` node ` ([ ` Node ` ] [ node ] )
89
+ — node to check (typically [ ` Element ` ] [ element ] )
89
90
90
91
###### Returns
91
92
92
93
Whether ` node ` is a labelable element (` boolean ` ).
93
- Labelable nodes have a ` tagName ` set to ` button ` , ` keygen ` ,
94
- ` meter ` , ` output ` , ` progress ` , ` select ` , ` textarea ` , and ` input `
95
- (excluding ` [type=hidden] ` ).
94
+
95
+ Labelable elements are ` button ` , ` keygen ` , ` meter ` , ` output ` , ` progress ` ,
96
+ ` select ` , ` textarea ` , and ` input ` (excluding ` [type=hidden] ` ).
96
97
97
98
## Types
98
99
@@ -103,7 +104,7 @@ It exports no additional types.
103
104
104
105
Projects maintained by the unified collective are compatible with all maintained
105
106
versions of Node.js.
106
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
107
+ As of now, that is Node.js 14.14+ and 16 .0+.
107
108
Our projects sometimes work with older versions, but this is not guaranteed.
108
109
109
110
## Security
@@ -215,3 +216,5 @@ abide by its terms.
215
216
[ element ] : https://github.com/syntax-tree/hast#element
216
217
217
218
[ xss ] : https://en.wikipedia.org/wiki/Cross-site_scripting
219
+
220
+ [ labelable ] : #labelablenode
0 commit comments