@@ -44,7 +44,7 @@ with a tool such as recast or Babel.
44
44
## Install
45
45
46
46
This package is [ ESM only] [ esm ] .
47
- In Node.js (version 12.20+, 14.14+, 16.0+, or 18 .0+), install with [ npm] [ ] :
47
+ In Node.js (version 14.14+ and 16 .0+), install with [ npm] [ ] :
48
48
49
49
``` sh
50
50
npm install estree-util-attach-comments
114
114
115
115
## API
116
116
117
- This package exports the identifier ` attachComments ` .
117
+ This package exports the identifier [ ` attachComments ` ] [ attachcomments ] .
118
118
There is no default export.
119
119
120
120
### ` attachComments(tree, comments) `
121
121
122
122
Attach semistandard estree comment nodes to the tree.
123
123
124
- This mutates the given [ ` tree ` ] [ estree ] ( [ ` Program ` ] [ program ] ) .
124
+ This mutates the given [ ` tree ` ] [ estree ] .
125
125
It takes ` comments ` , walks the tree, and adds comments as close as possible
126
126
to where they originated.
127
127
@@ -139,9 +139,16 @@ of visitor keys.
139
139
The algorithm supports ` loc ` fields (line/column), ` range ` fields (offsets),
140
140
and direct ` start ` / ` end ` fields.
141
141
142
+ ###### Parameters
143
+
144
+ * ` tree ` ([ ` Program ` ] [ program ] )
145
+ — tree to attach to
146
+ * ` comments ` (` Array<EstreeComment> ` )
147
+ — list of comments
148
+
142
149
###### Returns
143
150
144
- The given ` tree ` (` Node ` ).
151
+ The given ` tree ` ([ ` Program ` ] [ program ] ).
145
152
146
153
## Types
147
154
@@ -152,7 +159,7 @@ It exports no additional types.
152
159
153
160
Projects maintained by the unified collective are compatible with all maintained
154
161
versions of Node.js.
155
- As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18 .0+.
162
+ As of now, that is Node.js 14.14+ and 16 .0+.
156
163
Our projects sometimes work with older versions, but this is not guaranteed.
157
164
158
165
## Contribute
@@ -222,3 +229,5 @@ abide by its terms.
222
229
[ estree ] : https://github.com/estree/estree
223
230
224
231
[ program ] : https://github.com/estree/estree/blob/master/es5.md#programs
232
+
233
+ [ attachcomments ] : #attachcommentstree-comments
0 commit comments