Skip to content

Commit e88a13d

Browse files
committed
Refactor docs
1 parent 58973ab commit e88a13d

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

readme.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ looking for!
3838
## Install
3939

4040
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][]:
4242

4343
```sh
4444
npm install hast-util-labelable
@@ -63,20 +63,21 @@ In browsers with [`esm.sh`][esmsh]:
6363
```js
6464
import {labelable} from 'hast-util-labelable'
6565

66-
labelable({type: 'element', tagName: 'div'}) // => false
66+
labelable({type: 'element', tagName: 'div', properties: {}, children: []}) // => false
6767

68-
labelable({type: 'element', tagName: 'input'}) // => true
68+
labelable({type: 'element', tagName: 'input', properties: {}, children: []}) // => true
6969

7070
labelable({
7171
type: 'element',
7272
tagName: 'input',
73-
properties: {type: 'hidden'}
73+
properties: {type: 'hidden'},
74+
children: []
7475
}) // => false
7576
```
7677

7778
## API
7879

79-
This package exports the identifier [`labelable`][labelable].
80+
This package exports the identifier [`labelable`][api-labelable].
8081
There is no default export.
8182

8283
### `labelable(node)`
@@ -92,8 +93,8 @@ Check if the given value is a [*labelable element*][spec].
9293

9394
Whether `node` is a labelable element (`boolean`).
9495

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`.
9798

9899
## Types
99100

@@ -102,10 +103,13 @@ It exports no additional types.
102103

103104
## Compatibility
104105

105-
Projects maintained by the unified collective are compatible with all maintained
106+
Projects maintained by the unified collective are compatible with maintained
106107
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.
109113

110114
## Security
111115

@@ -173,9 +177,9 @@ abide by its terms.
173177

174178
[downloads]: https://www.npmjs.com/package/hast-util-labelable
175179

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
177181

178-
[size]: https://bundlephobia.com/result?p=hast-util-labelable
182+
[size]: https://bundlejs.com/?q=hast-util-labelable
179183

180184
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
181185

@@ -217,4 +221,4 @@ abide by its terms.
217221

218222
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
219223

220-
[labelable]: #labelablenode
224+
[api-labelable]: #labelablenode

0 commit comments

Comments
 (0)