@@ -41,7 +41,7 @@ a lot when working with classes in the syntax tree.
41
41
## Install
42
42
43
43
This package is [ ESM only] [ esm ] .
44
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
44
+ In Node.js (version 16 +), install with [ npm] [ ] :
45
45
46
46
``` sh
47
47
npm install hast-util-classnames
@@ -76,7 +76,7 @@ console.log(classnames(node, 'bravo', ['charlie', {delta: false, echo: 1}]))
76
76
Yields:
77
77
78
78
``` js
79
- [' 123 ' , ' alpha ' , ' charlie' ]
79
+ [' alpha ' , ' 123 ' , ' charlie' ]
80
80
{
81
81
type: ' element' ,
82
82
tagName: ' p' ,
@@ -87,7 +87,7 @@ Yields:
87
87
88
88
## API
89
89
90
- This package exports the identifier [ ` classnames ` ] [ classnames ] .
90
+ This package exports the identifier [ ` classnames ` ] [ api- classnames] .
91
91
There is no default export.
92
92
93
93
### ` classnames([node, ]…conditionals) `
@@ -106,7 +106,7 @@ This function has two signatures, depending on whether a `node` was passed.
106
106
* ` node ` ([ ` Node ` ] [ node ] )
107
107
— optionally, node whose classes to append to (must be
108
108
[ ` Element ` ] [ element ] )
109
- * ` conditionals ` ([ ` Array<Conditional> ` ] [ conditional ] )
109
+ * ` conditionals ` ([ ` Array<Conditional> ` ] [ api- conditional] )
110
110
— class configuration to merge
111
111
112
112
###### Returns
@@ -155,16 +155,19 @@ type Conditional =
155
155
## Types
156
156
157
157
This package is fully typed with [TypeScript][].
158
- It exports the additional types [ ` Conditional ` ][conditional],
159
- [ ` ConditionalMap ` ][conditionalmap ], and
160
- [ ` ConditionalPrimitive ` ][conditionalprimitive ].
158
+ It exports the additional types [ ` Conditional ` ][api- conditional],
159
+ [ ` ConditionalMap ` ][api-conditional-map ], and
160
+ [ ` ConditionalPrimitive ` ][api-conditional-primitive ].
161
161
162
162
## Compatibility
163
163
164
- Projects maintained by the unified collective are compatible with all maintained
164
+ Projects maintained by the unified collective are compatible with maintained
165
165
versions of Node.js.
166
- As of now, that is Node.js 14.14+ and 16.0+.
167
- Our projects sometimes work with older versions, but this is not guaranteed.
166
+
167
+ When we cut a new major release, we drop support for unmaintained versions of
168
+ Node.
169
+ This means we try to keep the current release line, ` hast -util -classnames @^2 ` ,
170
+ compatible with Node.js 12.
168
171
169
172
## Security
170
173
@@ -213,9 +216,9 @@ abide by its terms.
213
216
214
217
[downloads]: https://www.npmjs.com/package/hast-util-classnames
215
218
216
- [size-badge]: https://img.shields.io/bundlephobia/minzip/ hast-util-classnames.svg
219
+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= hast-util-classnames
217
220
218
- [size]: https://bundlephobia .com/result?p =hast-util-classnames
221
+ [size]: https://bundlejs .com/?q =hast-util-classnames
219
222
220
223
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
221
224
@@ -255,10 +258,10 @@ abide by its terms.
255
258
256
259
[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
257
260
258
- [classnames]: #classnamesnode-conditionals
261
+ [api- classnames]: #classnamesnode-conditionals
259
262
260
- [conditional]: #conditional
263
+ [api- conditional]: #conditional
261
264
262
- [conditionalmap ]: #conditionalmap
265
+ [api-conditional-map ]: #conditionalmap
263
266
264
- [conditionalprimitive ]: #conditionalprimitive
267
+ [api-conditional-primitive ]: #conditionalprimitive
0 commit comments