@@ -38,7 +38,7 @@ looking for!
38
38
## Install
39
39
40
40
This package is [ ESM only] [ esm ] .
41
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
41
+ In Node.js (version 16 +), install with [ npm] [ ] :
42
42
43
43
``` sh
44
44
npm install hast-util-labelable
@@ -63,20 +63,21 @@ In browsers with [`esm.sh`][esmsh]:
63
63
``` js
64
64
import {labelable } from ' hast-util-labelable'
65
65
66
- labelable ({type: ' element' , tagName: ' div' }) // => false
66
+ labelable ({type: ' element' , tagName: ' div' , properties : {}, children : [] }) // => false
67
67
68
- labelable ({type: ' element' , tagName: ' input' }) // => true
68
+ labelable ({type: ' element' , tagName: ' input' , properties : {}, children : [] }) // => true
69
69
70
70
labelable ({
71
71
type: ' element' ,
72
72
tagName: ' input' ,
73
- properties: {type: ' hidden' }
73
+ properties: {type: ' hidden' },
74
+ children: []
74
75
}) // => false
75
76
```
76
77
77
78
## API
78
79
79
- This package exports the identifier [ ` labelable ` ] [ labelable ] .
80
+ This package exports the identifier [ ` labelable ` ] [ api- labelable] .
80
81
There is no default export.
81
82
82
83
### ` labelable(node) `
@@ -92,8 +93,8 @@ Check if the given value is a [*labelable element*][spec].
92
93
93
94
Whether ` node ` is a labelable element (` boolean ` ).
94
95
95
- Labelable elements are ` button ` , ` keygen ` , ` meter ` , ` output ` , ` progress ` ,
96
- ` select ` , ` textarea ` , and ` input ` (excluding ` [type=hidden] ` ) .
96
+ Labelable elements are ` button ` , ` input ` (excluding ` [type=hidden] ` ) , ` keygen ` ,
97
+ ` meter ` , ` output ` , ` progress ` , ` select ` , and ` textarea ` .
97
98
98
99
## Types
99
100
@@ -102,10 +103,13 @@ It exports no additional types.
102
103
103
104
## Compatibility
104
105
105
- Projects maintained by the unified collective are compatible with all maintained
106
+ Projects maintained by the unified collective are compatible with maintained
106
107
versions of Node.js.
107
- As of now, that is Node.js 14.14+ and 16.0+.
108
- Our projects sometimes work with older versions, but this is not guaranteed.
108
+
109
+ When we cut a new major release, we drop support for unmaintained versions of
110
+ Node.
111
+ This means we try to keep the current release line, ` hast-util-labelable@^2 ` ,
112
+ compatible with Node.js 12.
109
113
110
114
## Security
111
115
@@ -173,9 +177,9 @@ abide by its terms.
173
177
174
178
[ downloads ] : https://www.npmjs.com/package/hast-util-labelable
175
179
176
- [ size-badge ] : https://img.shields.io/bundlephobia/minzip/ hast-util-labelable.svg
180
+ [ size-badge ] : https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= hast-util-labelable
177
181
178
- [ size ] : https://bundlephobia .com/result?p =hast-util-labelable
182
+ [ size ] : https://bundlejs .com/?q =hast-util-labelable
179
183
180
184
[ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
181
185
@@ -217,4 +221,4 @@ abide by its terms.
217
221
218
222
[ xss ] : https://en.wikipedia.org/wiki/Cross-site_scripting
219
223
220
- [ labelable ] : #labelablenode
224
+ [ api- labelable] : #labelablenode
0 commit comments